/sys$common/syshlp/helplib.hlb TCPIP Services, Programming Interfaces, Sockets API, sendto(), Description *Conan The Librarian (sorry for the slow response - running on an old VAX) |
This function can be used on sockets to send data to named sockets. The data in the msg buffer is sent to the socket whose address is specified in the to argument, and the address of socket s is provided to the receiving socket. The receiving socket gets the data using the read(), recv(), recvfrom(), or recvmsg() function. If there is no space available to buffer the data being sent on the receiving end of the connection, the sendto() function blocks until buffer space becomes available. If the socket is defined as nonblocking, the sendto() function fails with an errno indication of EWOULDBLOCK. If the message is too large to be sent in one piece and the socket type requires that messages be sent atomically (SOCK_DGRAM), the sendto() function fails with an errno indication of EMSGSIZE. No indication of failure to deliver is implicit in a sendto(). All errors (except EWOULDBLOCK) are detected locally. You can use the select() function to determine when it is possible to send more data. If the address specified is a INADDR_BROADCAST address, then the SO_BROADCAST socket option must have been set and the process must have SYSPRV or BYPASS privilege for the I/O operation to succeed. Related Functions See also read(), recv(), recvfrom(), recvmsg(), socket(), and getsockopt().
|