TCP/IP Programming Manual

level
input value; the socket level at which the socket option is being managed. The possible values
are:
Socket-level option.SOL_SOCKET
TCP-level option.IPPROTO_TCP
IP-level option for INET sockets.IPPROTO_IP
IP-level option for INET6 sockets.IPPROTO_IPV6
ICMP-level option.IPPROTO_ICMP
Raw-socket level option.IPPROTO_RAW
Option for a user-defined protocol above IP, such as PUP.user-protocol
user-protocol can be any protocol number other than the numbers for TCP, UDP, IP, ICMP,
and RAW. Appendix A (page 241), lists the protocol numbers.
optname
input value; the socket option name.
When level is SOL_SOCKET, the possible values are:
Broadcast messages when data is sent. For UDP sockets, see Usage Guidelines (page 188)SO_BROADCAST
Get the error status and clear the socket error. This option applies only to the
getsockopt function.
SO_ERROR
Get the socket type. This option applies only to the getsockopt and getsockopt_nw
functions. The possible values are:
SO_TYPE
SOCK_STREAMStream socket.
SOCK_DGRAM Datagram socket.
SOCK_RAW Raw socket.
Do not route messages.SO_DONTROUTE
Allow reuse of local port addresses in a bind operation.SO_REUSEADDR
Cause connections to close gracefully, and wait for data transfer to complete. This option
is provided for compatibility only. All TCP/IP connections close gracefully.
SO_LINGER
Keep connections alive during inactivity by sending “keep-alive messages. A keep-alive
message is a probe segment that causes the receiver to return an acknowledgment
SO_KEEPALIVE
segment, confirming that the connection is still alive. For a detailed description of this
mechanism, see RFC 1122.
Keep out-of-band data in with normal data. If out-of-band data is kept with the normal
data, the application must discard normal data until the out-of-band data is read.
SO_OOBINLINE
Set the size of the send window. The SO_RCVBUF and SO_SNDBUF options are used
as hints for determining how much space to allocate in the underlying network I/O
SO_SNDBUF
buffers. The buffer size may be increased for high-volume connections, or may be
decreased to limit the possible backlog of incoming data. See Usage Guidelines
(page 188).
Set the size of the receive window. The SO_RCVBUF and SO_SNDBUF options are used
as hints for determining how much space to allocate in the underlying network I/O
SO_RCVBUF
buffers. The buffer size may be increased for high-volume connections, or may be
decreased to limit the possible backlog of incoming data. See Usage Guidelines
(page 188) and Considerations for a Server Posting Receives (page 35).
Allow local address and port reuse for UDP sockets receiving multicast datagrams. See
“Receiving IPv4 Multicast Datagrams” (page 45)
SO_REUSEPORT
setsockopt, setsockopt_nw 185