SockIoctl

The SockIoctl() call performs special operations on the socket.

Syntax:

>>--SockIoctl(socket, ioctlCmd, ioctlData)-------------------------------><

where:

socket

is the socket descriptor.

ioctlCmd

is the ioctl command to be performed.

ioctlData

is a variable containing data associated with the particular command. Its format depends on the command requested. Valid commands are:

FIONBIO

sets or clears nonblocking input or output for a socket. This command is an integer. If the integer is 0, nonblocking input or output on the socket is cleared. If the integer is a number other than 0, input or output calls do not block until the call is completed.

FIONREAD

gets the number of immediately readable bytes for the socket. This command is an integer.

Return values:

The value 0 indicates successful execution of the call. The value -1 indicates an error. You can get the specific error code SockSock_Errno() or SockPSock_Errno(). Possible values are:

ENOTSOCK

socket is not a valid socket descriptor.

EINVAL

The request is not valid or not supported.

EOPNOTSUPP

The operation is not supported on the socket.

Note: SockIoctl() interfaces with the C function ioctl() or, in the Windows environments, with ioctlsocket().