Group: Windows Sockets 2 (Winsock) - Library: ws2_32
Winsock: reading and setting socket options
int setsockopt(
SOCKET s,
int level,
int optname,
const char* optval,
int optlen
);
DECLARE INTEGER setsockopt IN ws2_32;
INTEGER s,;
INTEGER level,;
INTEGER optname,;
STRING @ optval,;
INTEGER optlen
s [in] Descriptor identifying a socket.
level [in] Level at which the option is defined. Example: SOL_SOCKET.
optname [in] Socket option for which the value is to be set.
optval [in] Pointer to the buffer in which the value for the requested option is specified.
optlen [in] Size of the optval buffer, in bytes.
If no error occurs, setsockopt returns zero. Otherwise, a value of SOCKET_ERROR is returned, and a specific error code can be retrieved by calling WSAGetLastError.
See also getsockopt function.