Technical data
tcp(7P) Protocols SunOS 5.5
Therefore, TCP provides a boolean option, TCP_NODELAY (defined in <netinet/tcp.h>),
to defeat this algorithm. The option level for the setsockopt() call is the protocol number
for TCP, available from getprotobyname(3N).
Options at theIP level may be used with TCP. See ip(7P).
TCP provides an urgent data mechanism, which may be invoked using the out-of-band
provisions of send(3N). The caller may mark one byte as “urgent” with the MSG_OOB
flag to send(3N). This sets an “urgent pointer” pointing to this byte in the TCP stream.
The receiver on the other side of the stream is notified of the urgent data by a SIGURG
signal. The SIOCATMARK ioctl() request returns a value indicating whether the stream
is at the urgent mark. Because the system never returns data across the urgent mark in a
single read(2) call, it is possible to advance to the urgent data in a simple loop which
reads data, testing the socket with the SIOCATMARK ioctl() request, until it reaches the
mark.
Incoming connection requests that include an IP source route option are noted, and the
reverse source route is used in responding.
A checksum over all data helpsTCP implement reliability. Using a window-based flow
control mechanism that makes use of positive acknowledgements, sequence numbers,
and a retransmission strategy,TCP can usuallyrecover when datagrams are damaged,
delayed, duplicated or delivered out of order by the underlyingcommunication medium.
If the local TCP receives no acknowledgements from its peer for a period of time, as
would be the case if the remote machine crashed, the connection is closed and an error is
returned to the user. If the remote machine reboots or otherwise loses state information
about a TCP connection, the connection is aborted and an error is returned to the user.
SEE ALSO read(2), write(2), accept(3N), bind(3N), connect(3N), getprotobyname(3N),
getsockopt(3N), listen(3N), send(3N), inet(7P), ip(7P)
Postel, Jon, Transmission Control Protocol - DARPA Internet Program Protocol Specification,
RFC 793, Network Information Center, SRI International, Menlo Park, Calif., September
1981.
DIAGNOSTICS A socket operation may fail if:
EISCONN A connect() operation was attempted on a socket on which a con-
nect() operation had already been performed.
ETIMEDOUT A connection was dropped due to excessive retransmissions.
ECONNRESET The remote peer forced the connection to be closed (usually
because the remote machine has lost state information about the
connection due to a crash).
ECONNREFUSED The remote peer actively refused connection establishment (usu-
ally because no process is listeningto the port).
EADDRINUSE A bind() operation was attempted on a socket with a network
address/port pair that has already been bound to another socket.
7P-342 modified 3 Jul 1990










