HP-UX Reference (11i v3 07/02) - 7 Device (Special) Files, 9 General Information, Index (vol 10)

t
TCP(7P) TCP(7P)
unacknowledged data, the system gathers small amounts of data to be sent in a single packet once an ack-
nowledgement is received. For clients such as window managers that send a stream of mouse events which
receive no replies, this packetization may cause significant delays. The
TCP_NODELAY option can be used
to avoid this situation. Note, however, that setting the
TCP_NODELAY option may result in a large
number of small packets being sent over the network.
By default,
TCP_NODELAY is not set when a socket is created.
The option level to use for accessing the TCP option with the
setsockopt() or getsockopt() calls is
the protocol number for TCP which is available from
getprotobyname()
(see getprotoent (3N)).
If the
SO_KEEPALIVE socket option is enabled on an established TCP connection and the connection has
been idle for two hours, TCP sends a packet to the remote socket, expecting the remote TCP to ack-
nowledge that the connection is still active. If the remote TCP does not respond in a timely manner, TCP
continues to send keepalive packets according to its 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]. See getsockopt(2) for details on
enabling
SO_KEEPALIVE .
The default send and receives buffer size is 32768 bytes (see WARNINGS below). The send and receive
buffer sizes for TCP stream sockets can be altered by using the
SO_SNDBUF and
SO_RCVBUF options of
the
setsockopt() system call or the XTI_SNDBUF and XTI_RCVBUF options of the t_optmgmt()
system call. Refer to getsockopt (2) or t_optmgmt (3) for details.
The maximum transmit buffer size for a TCP stream socket is 2147483647 bytes. The maximum receive
buffer size for a TCP stream socket is 1073725440 bytes. These maximum values can be lowered using the
ndd variables tcp_xmit_hiwater_max
and tcp_recv_hiwater_max.
ERRORS
One of the following errors may be returned in
errno if a socket operation fails. For a more detailed list
of errors, see the man pages for specific system calls.
[EISCONN] The socket is already connected.
[ENOBUFS] No buffer space is available for an internal data structure.
[ETIMEDOUT]
Connection dropped due to excessive retransmissions.
[ECONNRESET]
The connection was forcibly closed by the peer socket.
[ECONNREFUSED]
Remote peer actively refuses connection establishment (usually because no process is
listening to the port).
[EADDRINUSE]
The specified address is already in use.
[EADDRNOTAVAIL]
The specified address is not available on this machine.
WARNINGS
The default socket buffer size might increase without notice in a future release or patch. Therefore, if an
application calls setsockopt() with SO_RCVBUF, it should do so before calling listen() ,orit
should first call getsockopt() with SO_RCVBUF and ensure that the intended new receive buffer size
is not less than the current buffer size. These programming conventions are consistent with TCP protocol
restrictions against reducing the TCP receive window after a connection has been established.
AUTHOR
The socket interfaces to TCP were developed by the University of California, Berkeley.
SEE ALSO
ndd(1M), getsockopt(2), recv(2), send(2), socket(2), t_open(3), t_optmgmt(3), socket(7), inet(7F).
RFC 793 Transmission Control Protocol
RFC 1122 Requirements for Internet hosts
RFC 1323 TCP Extensions for High Performance
206 Hewlett-Packard Company 3 HP-UX 11i Version 3: February 2007