Node:Socket Option Functions, Next:Socket-Level Options, Up:Socket Options
Here are the functions for examining and modifying socket options.
They are declared in sys/socket.h
.
int getsockopt (int socket, int level, int optname, void *optval, socklen_t *optlen-ptr) | Function |
The getsockopt function gets information about the value of
option optname at level level for socket socket.
The option value is stored in a buffer that optval points to.
Before the call, you should supply in Most options interpret the optval buffer as a single The actual return value of
|
int setsockopt (int socket, int level, int optname, void *optval, socklen_t optlen) | Function |
This function is used to set the socket option optname at level level for socket socket. The value of the option is passed in the buffer optval of size optlen. |