gtpc1m33Transmission Control Protocol/Internet Protocol

Blocking and Nonblocking

Sockets can be set to either blocking or nonblocking I/O mode. The FIONBIO option on the ioctl call determines the mode. When FIONBIO is set, the socket is marked nonblocking. If a read, recv, or recvfrom function is tried and the desired data is not available, the socket does not wait for the data to become available but returns immediately with the SOCWOULDBLOCK secondary error code.

When FIONBIO is not set, the socket is in blocking mode. If a read, recv, or recvfrom function is tried and the desired data is not available, the calling process waits for the data. When a socket is created, the default mode is blocking.

Calls that are affected by the FIONBIO flag are: