Node:Socket-Level Options, Previous:Socket Option Functions, Up:Socket Options
int SOL_SOCKET | Constant |
Use this constant as the level argument to getsockopt or
setsockopt to manipulate the socket-level options described in
this section.
|
Here is a table of socket-level option names; all are defined in the
header file sys/socket.h
.
SO_DEBUG
int
; a nonzero value means
"yes".
SO_REUSEADDR
bind
(see Setting Address)
should permit reuse of local addresses for this socket. If you enable
this option, you can actually have two sockets with the same Internet
port number; but the system won't allow you to use the two
identically-named sockets in a way that would confuse the Internet. The
reason for this option is that some higher-level Internet protocols,
including FTP, require you to keep reusing the same port number.
The value has type int
; a nonzero value means "yes".
SO_KEEPALIVE
int
; a nonzero value means
"yes".
SO_DONTROUTE
int
; a nonzero
value means "yes".
SO_LINGER
struct linger
.
struct linger | Data Type |
This structure type has the following members:
|
SO_BROADCAST
int
; a nonzero value means "yes".
SO_OOBINLINE
read
or recv
without specifying the MSG_OOB
flag. See Out-of-Band Data. The value has type int
; a
nonzero value means "yes".
SO_SNDBUF
size_t
, which is the size in bytes.
SO_RCVBUF
size_t
, which is the size in bytes.
SO_STYLE
SO_TYPE
getsockopt
only. It is used to
get the socket's communication style. SO_TYPE
is the
historical name, and SO_STYLE
is the preferred name in GNU.
The value has type int
and its value designates a communication
style; see Communication Styles.
SO_ERROR
getsockopt
only. It is used to reset
the error status of the socket. The value is an int
, which represents
the previous error status.