TCP/IP Programming Manual

int error, socket;
char *nbuffer_ptr;
int nbuffer_length, flags;
long tag;
TAL Synopsis
?NOLIST, SOURCE SOCKDEFT
?NOLIST, SOURCE SOCKPROC
error := send_nw2 (socket, nbuffer_ptr, nbuffer_length,
flags, tag);
INT(32) error,
socket;
STRING .EXT nbuffer_ptr;
INT(32) nbuffer_length,
flags;
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 174).
socket
input value; specifies the socket number for the socket, as returned by the call to socket_nw.
nbuffer_ptr
input value; specifies the data to be sent. Call AWAITIOX to complete the send_nw2 call.
nbuffer_length
input value; the size of the buffer pointed to by nbuffer_ptr.
flags
input value; specifies the kind of data to be sent, or specifies a routing restriction. flags has
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
Send the data as out-of-band data. This corresponds to the TCP URG flag.MSG_OOB
Send normal data.0
tag
is the tag parameter to be used for the nowait operation initiated by send_nw2.
Errors
If an error occurs, the external variable errno is set to one of the following values:
The send buffer is already full.EALREADY
The message was too large to be sent atomically, as required by the socket options.EMSGSIZE
The specified socket was not connected.ENOTCONN
The specified socket was shut down.ESHUTDOWN
The connection timed out.ETIMEDOUT
The connection was reset by the remote host.ECONNRESET
An invalid flags value was specified.EINVAL
There is out-of-band data pending. This must be cleared with a call to recv_nw with the
MSG_OOB flag set.
EHAVEOOB
174 Library Routines