HP-UX Reference (11i v1 00/12) - 2 System Calls (vol 5)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man2/!!!intro.2
________________________________________________________________
___ ___
g
getsockopt(2) getsockopt(2)
buffer size can be lowered using the ndd parameter
udp_recv_hiwater_max).
SO_REUSEADDR (int; boolean; AF_INET sockets only) If enabled, allows a local address to
be reused in subsequent calls to bind(). Default: disallowed.
SO_REUSEPORT (int; boolean; AF_INET sockets only) If enabled, allows a local address
and port to be reused in subsequent calls to bind(). Default: disal-
lowed.
SO_SNDBUF (int) Specifies the maximum size, in bytes, of the send socket buffer. For
SOCK_STREAM sockets, the send buffer size limits how much data can be
queued for transmission before the application is blocked. For
SOCK_DGRAM sockets, the send buffer size may limit the maximum size of
messages that the application can send through the socket. Default
and maximum values are
protocol-dependent; see individual proto-
col manual entries, such as tcp(7P) (default send buffer size: 32768 bytes;
maximum send buffer size: 2147483647bytes; maximum buffer size can be
lowered using the ndd variable tcp_xmit_hiwater_max) and udp(7P)
(default send buffer size: 65535 bytes; maximum send buffer size:
2147483647bytes).
SO_TYPE (int) Returns the socket type.
SO_USELOOPBACK (int; boolean) Not used internally; provided only for compatibility.
Setting the
SO_BROADCAST option allows the application to send messages through the SOCK_DGRAM
socket to a broadcast destination address.
If
SO_DONTROUTE is set, the system does not use the network routing tables when determining which
interface to use to send an outbound message. Instead, the system sends the message through the inter-
face whose network address matches the network portion of the destination address. If SO_DONTROUTE
is not set (default), the system uses the network routing tables.
If SO_KEEPALIVE is disabled (default), a TCP connection may remain idle until the connection is
released at the protocol layer. If SO_KEEPALIVE is enabled and the connection has been idle for two
hours, TCP sends a packet to the remote socket, expecting the remote TCP to acknowledge that the connec-
tion is still active. If the remote TCP does not respond in a timely manner, TCP continues to send
keepalive packets according to the normal retransmission algorithm. If the remote TCP does not respond
within a particular time limit, TCP drops the connection. The next socket system call (for example,
recv()) returns an error, and errno is set to ETIMEDOUT.
SO_LINGER controls the actions to be taken when there are untransmitted data in a
SOCK_STREAM send
socket buffer when the socket is closed, either due to an explicit call to
close() or because the applica-
tion terminates normally or abnormally. The action is determined by the values of members of the
struct linger data structure pointed to by optval in a call to setsockopt() . The data type
struct linger is defined in <sys/socket.h >. If l_onoff is zero (the default action), close()
returns immediately, but the system tries to transmit any unsent data and release the protocol connection
gracefully. If l_onoff is non-zero and l_linger is zero, close() returns immediately, any unsent
data is discarded, and the protocol connection is aborted. If both l_onoff and l_linger are non-zero,
close() does not return until the system has tried to transmit all unsent data and release the connection
gracefully. In that case, close() can return an error, and errno may be set to ETIMEDOUT,
if the sys-
tem is unable to transmit the data after a protocol-defined time limit. Note that the value of
l_linger
is treated simply as a boolean; a non-zero value is not interpreted as a time limit( see
_XOPEN_SOURCE_EXTENDED Only
below). SO_LINGER does not affect the actions taken when the
function
shutdown() is called.
If SO_OOBINLINE is set, out-of-band data (TCP "urgent data") is left "in-line" among the normal data
stream. In that case, the SIOCATMARK ioctl() request must be used to determine if the inbound data
stream has been read up to the point where the out-of-band data begins. If multiple transmissions of out-
of-band data are received before the application reads them, all of the data is left in-line; however, SIOCAT-
MARK indicates the location of only the last transmission of out-of-band data. If SO_OOBINLINE is not
set (default), only one byte of out-of-band is saved. This byte is pulled out of the normal data stream, and it
is accessible only by setting MSG_OOB in the flags parameter when the application reads the data (see
recv(2)). In that case, if multiple transmissions of out-of-band data are received before the application
reads them, previous bytes of out-of-band data are lost.
Section 2114 3 HP-UX Release 11i: December 2000
___
___