TCP/IP Programming Manual
flags
INT .EXT sockaddr_ptr(sockaddr);
INT(32) tag;
error
return value; if the call is successful, a zero is returned. If the call is not successful, –1 is returned.
If the call failed, the external variable errno is set as indicated in Errors (page 205).
socket
input value; specifies the socket number for the socket, as returned by a socket_nw call.
r_buffer_ptr
input and return value; points to the remote address and port number to which the data is to
be sent, followed by the data. The address of the data is (r_buffer_ptr + sizeof(struct
sockaddr_in)). See the sendto_recvfrom_buf structure in “Data Structures”.
Note that the first two bytes pointed to by r_buffer_ptr are the sin_family field of the
sockaddr_in structure. After a call to t_sendto_nw, the normal value in the sin_family
field (AF_INET) is replaced by the number of bytes that have been transferred.
length
input value; the size of the buffer pointed to by r_buffer_ptr.
flags
input value; specifies whether the outgoing data should be sent to the destination if routing is
required. This parameter can be one of the following values:
Send this message only if the destination is located on the local network; do not send
the message through a gateway.
MSG_DONTROUTE
No flag; send the message to the destination, even if the message must be routed.0
tag
input value; the tag parameter to be used for the nowait operation initiated by t_sendto_nw.
Errors
If an error occurs, the external variable errno is set to one of the following values:
The message was too large to be sent atomically, as required by the socket options.EMSGSIZE
The specified socket was connected.EISCONN
The specified socket was shut down.ESHUTDOWN
The destination network was unreachable.ENETUNREACH
An invalid argument was specified.EINVAL
Usage Guidelines
• This is a nowait call; it must be completed with a call to the AWAITIOX procedure. For a
waited call, use sendto.
• The parameters of the t_sendto_nw function are not compatible with those of the sendto
function in the 4.3 BSD UNIX operating system.
• To determine the number of bytes transferred as a result of the t_sendto_nw function, check
the sb_sent field of the sendto_recvfrm_buf structure. This field is defined the same as
the sin_family field of the sockaddr_in structure. After you use this value, reset the
sin_family field to AF_INET.
See Nowait Call Errors (page 86) for information on error checking.
t_sendto_nw 205