send.2 (2010 09)

s
send(2) send(2)
its peer.
[ENOTSOCK] s is a valid file descriptor, but it is not a socket.
[EOPNOTSUPP] The
MSG_OOB flag was specified; it is not supported for AF_UNIX or
AF_VME_LINK sockets.
[EPIPE] and
SIGPIPE signal
An attempt was made to send on a socket that was connected, but the connec-
tion has been shut down either by the remote peer or by this side of the con-
nection. Note that the default action for SIGPIPE
, unless the process has
established a signal handler for this signal, is to terminate the process.
[EWOULDBLOCK] Nonblocking I/O is enabled using
ioctl() FIOSNBIO request and the
requested operation would block.
DEPENDENCIES
UDP messages are fragmented at the IP level into Maximum Transmission Unit (MTU) sized pieces; MTU
varies for different link types. These pieces, called IP fragments, can be transmitted, but IP does not
guarantee delivery. Sending large messages may cause too many fragments and overrun a receiver’s abil-
ity to receive them. If this happens the complete message cannot be reassembled. This affects the
apparent reliability and throughput of the network as viewed by the end user.
The default and maximum buffer sizes are protocol-specific. Refer to the appropriate entries in Sections
7F and 7P for details. The buffer size can be set by calling
setsockopt() with
SO_SNDBUF.
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,
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, applications that need to be port-
able 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
send(), sendmsg(), and sendto() were developed by HP and the University of California, Berke-
ley.
The
MSG_EOF feature is an HP-specific extension to the socket API.
SEE ALSO
ifconfig(1M), getsockopt(2), recv(2), select(2), setsockopt(2), shutdown(2), socket(2), thread_safety(5),
socket(7), xopen_networking(7), inet(7F), IPv6(7P), sctp(7), TCP(7P), UDP(7P), UNIX(7P).
STANDARDS CONFORMANCE
send(): XPG4, UNIX 95, UNIX 03
6 Hewlett-Packard Company 6 HP-UX 11i Version 3: September 2010