KwikNet TCP/IP Sockets
K
DAK
219
Description ...continued
Optionval is a pointer to the option value. The size of each option is
indicated in the option list. Note that
bool is an int value that is 1 if
the option is to be enabled or 0 if the option is to be disabled. The type
u/s long indicates a 32-bit value usually represented by an unsigned
long
. The structure linger required by option SO_LINGER is described
in header file KN_SOCK.H.
Optionlen is the length of the option value at the location referenced by
optionval.
Note Option SO_NONBLOCK is a unique KwikNet option which conditions a socket
such that subsequent socket operations proceed with or without blocking
the caller. Note that, although a socket is always a blocking socket when
first created, this option permits the mode of operation to be altered by
your application. The option value in the call must be non-zero to set
non-blocking mode or zero to restore the socket to blocking mode.
Returns If successful, a value of 0 is returned.
On failure, the error status -1 is returned.
The error indicator for socket s is set to define the reason for failure. Use
kn_errno() to retrieve the error code.
EBADF The socket descriptor s is invalid.
EINVAL One or more parameters are invalid or
parameter optionlen specifies a length that is less
than that required to specify the option.
ENOPROTOOPT The option is unknown at the level indicated.
EPERM The option cannot be set after a connection is
established.
See Also kn_getsockopt(), kn_socket()
Comments to this Manuals