C
Description
The sendto function is used to send outgoing data on a socket. The destination address is given by to and tolen. Both Datagram and stream sockets are supported.
Preconditions
socket function should be called.
Parameters
Parameters |
Description |
s |
Socket descriptor returned from a previous call to socket. |
buf |
application data buffer containing data to transmit. |
len |
length of data in bytes. |
flags |
message flags. Currently this field is not supported. |
to |
Optional pointer to the the sockaddr structure containing the destination address. If NULL, the currently bound remote port and IP address are used as the destination. |
tolen |
length of the sockaddr structure. |
Returns
On success, sendto returns number of bytes sent. In case of error returns SOCKET_ERROR
Remarks
None.