recv.2 (2010 09)

r
recv(2) recv(2)
[ENOSR] Buffers could not be allocated for the message that was to be created due to
insufficient STREAMS memory resources.
[ENOTCONN] Receive on a SOCK_STREAM socket that is not yet connected.
[ENOTSOCK] The argument s is a valid file descriptor, but it is not a socket.
[EOPNOTSUPP] The
MSG_OOB flag was set for a UDP SOCK_DGRAM message-based socket,
or
MSG_OOB or MSG_PEEK was set for any AF_UNIX socket. The
MSG_OOB
flag is supported only for stream-based TCP SOCK_STREAM sockets. Neither
MSG_PEEK nor MSG_OOB is supported for AF_UNIX sockets.
AF_CCITT only:
recv() was issued on a listen()
socket.
[ETIMEDOUT] The connection timed out during connection establishment, or due to a
transmission timeout on active connection.
[EWOULDBLOCK] Non-blocking I/O is enabled using
ioctl() FIOSNBIO request, and the
requested operation would block.
OBSOLESCENCE
Currently, the
socklen_t and size_t types are the same size. This is compatible with the UNIX 95
and UNIX 03 profiles. However, in a future release,
socklen_t might be a different size. In that case,
passing a
size_t pointer will evoke compile-time warnings, which must be corrected in order for the
application to behave correctly. Also, the size of the msghdr and cmsghdr structures and the relative
position of their members will be different, which might affect application behavior. Applications that use
socklen_t now, where appropriate, will avoid such migration problems. On the other hand, applica-
tions that need to be portable to the UNIX 95 profile should follow the X/Open specification (see
xopen_networking(7)).
WARNINGS
Linking binary objects compiled to X/Open Sockets specification and binary objects compiled to HP-UX
BSD Sockets specification to the same executable may result in unexpected behavior, including applica-
tion abnormal termination and unexpected socket errors. See xopen_networking(7) for details and
remedy.
FUTURE DIRECTION
Currently, the default behavior is the HP-UX BSD Sockets; however, it might be changed to X/Open
Sockets in a future release. At that time, any HP-UX BSD Sockets behavior that is incompatible with
X/Open Sockets might be obsoleted. Applications that conform to the X/Open specification now will
avoid migration problems (see xopen_networking(7)).
AUTHOR
recv(), recvmsg(), and recvfrom() were developed by HP and the University of California,
Berkeley.
SEE ALSO
getsockopt(2), read(2), select(2), send(2), socket(2), thread_safety(5), inet(7F), socket(7), IPv6(7P), sctp(7),
TCP(7P), UDP(7P), UNIX(7P), xopen_networking(7).
STANDARDS CONFORMANCE
recv(): XPG4, UNIX 95, UNIX 03
6 Hewlett-Packard Company 6 HP-UX 11i Version 3: September 2010