SENDTO

The SENDTO call sends packets on the socket that is associated with the specified fullword integer socket descriptor. This call applies to any datagram socket, whether connected or unconnected.

SOCKET SENDTO,(socket,buffer,buflen,flags,to,tolen)
socket
is the address of a fullword integer socket descriptor.
buffer
is the address of the storage area to which the data will be received.
buflen
is the address of a fullword containing the length of the buffer parameter.
flags
is the address of a fullword containing one of the following supported send flags:
MSG_OOB (1)
Sends any out-of-band data on sockets for which it is supported.
to
is the address of a string to receive the remote address and port that will receive the data. The format of this structure is defined by the SOCKADDR DSECT generated by the SOCKET DSECT macro call.
tolen
is the address of a fullword containing the length of the to parameter. The tolen value must be 16.
rc
(Output) is a value returned when the socket call completes successfully, which contains the number of bytes sent. This does not indicate, however, that the data was actually received or delivered to the other side of the socket. An rc value of -1 indicates a locally detected error.