int recv(int s, void *buf, size_t len, int flags);
For SOCK_DGRAM sockets, data is extracted from the
first queued datagram for the destination address specified in
the connect call. If unconnected, the socket must be bound and
have no source address restrictions on the datagrams received. If
the datagram is larger than the buffer supplied, the buffer is
filled with the first part of the datagram and
If the socket is connection-oriented and the remote side has shut down
the connection gracefully, a
flags may be used to influence the behavior of the function invocation beyond the options specified for the associated socket. That is, the semantics of this function are determined by the socket options and the flags parameter. The latter is constructed by or-ing any of the following values:
Peek at the incoming data. The data is copied into the buffer but is not removed from the input queue.
Process out-of-band data
Specifies a socket descriptor from which data should be received.
Points to the buffer in which to place the message.
Specifies the length of the buffer.
Lets the caller control the reception by peeking at incoming data (MSG_PEEK) or receive out-of-band data (MSG_OOB).
s is an invalid descriptor.
The virtual circuit was aborted because of a timeout or other failure.
The virtual circuit was reset by the remote host executing a hard or abortive close.
buf is an invalid pointer.
A signal interrupted the
The socket was not bound using
bind(), or an invalid flag was specified, or len was 0 or negative.
The message was too large to fit the specified buffer.
The network subsystem has failed.
The connection is broken; the remote host reset.
The socket is not connected.
s is not a socket descriptor.
MSG_OOB was specified on socket that does not support out of band data.
The socket has been shut down.
The connection has been dropped because of a network failure.
s is nonblocking and
UNIX 98, with exceptions.
The NuTCRACKER Platform supports all the address families that WinSock 2.0 supports.
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
bind(), connect(), ioctl(), read(), recvfrom(), recvmsg(), send(), sendmsg(), sendto(), socket(), socketpair()
PTC MKS Toolkit 10.3 Documentation Build 39.