Differences between version 3 and previous revision of recv(2).
Other diffs: Previous Major Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 3 | Last edited on Tuesday, November 18, 2003 11:50:32 am | by JohnMcPherson | Revert |
Older page: | version 2 | Last edited on Monday, March 17, 2003 12:38:09 am | by PerryLorier | Revert |
@@ -9,8 +9,9 @@
__int recvfrom(int__ ''s''__, void *__''buf''__, size_t__ ''len''__, int__ ''flags''__, struct sockaddr *__''from''__, socklen_t *__''fromlen''__);__
__int recvmsg(int__ ''s''__, struct msghdr *__''msg''__, int__ ''flags''__);__
+
!!DESCRIPTION
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 is connection-oriented.
If ''from'' is not NULL, and the socket is not connection-oriented, the source address of the message is filled in. The argument ''fromlen'' is a value-result parameter, initialized to the size of the buffer associated with ''from'', and modified on return to indicate the actual size of the address stored there.
@@ -32,9 +33,9 @@
;__MSG_PEEK__: This flag causes the receive operation to return data from the beginning of the receive queue without removing that data from the queue. Thus, a subsequent receive call will return the same data.
;__MSG_WAITALL__: This flag requests that the operation block until the full request is satisfied. However, the call may still return less data than requested if a signal is caught, an error or disconnect occurs, or the next data to be received is of a different type than that returned.
-;__
MSG_NOSIGNAL__
: This flag turns off raising of __
SIGPIPE__
on stream sockets when the other end disappears.
+;[
MSG_NOSIGNAL]
: This flag turns off raising of [
SIGPIPE]
on stream sockets when the other end disappears.
;__MSG_TRUNC__: Return the real length of the packet, even when it was longer than the passed buffer. Only valid for packet sockets.
;__MSG_ERRQUEUE__: This flag specifies that queued errors should be received from the socket error queue. The error is passed in an ancillary message with a type dependent on the protocol (for IPv4 __IP_RECVERR__). The user should supply a buffer of sufficient size. See cmsg(3) and ip(7) for more information. The payload of the original packet that caused the error is passed as normal data via __msg_iovec__. The original destination address of the datagram that caused the error is supplied via
@@ -105,9 +106,9 @@
;__MSG_OOB__: is returned to indicate that expedited or out-of-band data were received.
;__MSG_ERRQUEUE__: indicates that no data was received but an extended error from the socket error queue.
-;__MSG_DONTWAIT__: Enables non-blocking operation; if the operation would block, [EAGAIN] is returned (this can also be enabled using the __O_NONBLOCK__ with the __F_SETFL fcntl
__(2)).
+;__MSG_DONTWAIT__: Enables non-blocking operation; if the operation would block, [EAGAIN] is returned (this can also be enabled using the __O_NONBLOCK__ with the __F_SETFL__ fcntl
(2)).
!!RETURN VALUE
These calls return the number of bytes received, or -1 if an error occurred.