Sockets Programming Interfaces
3-20
SO_RCVLOWAT
Is an option to set the minimum count for input op-
erations. In general, receive calls will block until any
(non-zero) amount of data is received, then return
with the smaller of the amount specified by
SO_RCVLOWAT or the amount requested. The de-
fault value for SO_RCVLOWAT is 1. Receive calls
may still return less than the amount specified by
SO_RCVLOWAT or the amount requested if an er-
ror occurs, or the type of data next in the receive
queue is different from that which was returned.
SO_SNDTIMEO
Is an option to set a timeout value for output opera-
tions. It accepts a struct timeval parameter with the
number of seconds and microseconds used to limit
waits for output operations to complete. If a send
operation has blocked for this much time, it returns
with a partial count or with the error EWOULD-
BLOCK if no data were sent. In the current imple-
mentation, this timer is restarted each time addition-
al data are delivered to the protocol, implying that
the limit applies to output portions ranging in size
from the low water mark to the high water mark for
output.
SO_RCVTIMEO
Is an option to set a timeout value for input opera-
tions. It accepts a struct timeval parameter with the
number of seconds and microseconds used to limit
waits for input operations to complete. This timer is
restarted each time additional data are received by
the protocol, and thus the limit is in effect an inactiv-
ity timer. If a receive operation has been blocked for
this much time without receiving additional data, it
returns with a short count or with the error
EWOULDBLOCK if no data were received.
SO_TYPE
SO_TYPE returns the type of the socket, such as
SOCK_STREAM.
SO_ERROR
Returns any pending error on the socket and clears
the error status. It may be used to check for asyn-
chronous errors on connected datagram sockets or
for other asynchronous errors.