![]() ![]() The select(2) or poll(2) call may be used to determine when more data arrives. The receive calls normally return any dataĪvailable, up to the requested amount, rather than waiting for receipt of the full amount requested. If no messages are available at the socket, the receive calls wait for a message to arrive, unless the socket is nonblocking (see fcntl(2)), in whichĬase the value -1 is returned and the external variable errno is set to EAGAIN or EWOULDBLOCK. If a message is too long to fit in the supplied buffer, excess bytes may beĭiscarded depending on the type of socket the message is received from. ![]() The recv() call is normally used only on a connected socket (see connect(2)) and is identical to recvfrom() with a NULLĪll three routines return the length of the message on successful completion. The returned address is truncated if the buffer provided is too small in this case, addrlen will return a value greater than was The argument addrlen is a value-result argument, which theĬaller should initialize before the call to the size of the buffer associated with src_addr, and modified on return to indicate the actual size of the Nothing is filled in in this case, addrlen is not used, and should also be NULL. If src_addr is not NULL, and the underlying protocol provides the source address, this source address is filled in. The recvfrom() and recvmsg() calls are used to receive messages from a socket, and may be used to receive data on a socket whether or not it
0 Comments
Leave a Reply. |