TCP/IP Programming Manual

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_nw64_ with
the MSG_OOB flag set.
EHAVEOOB
Usage Guidelines
The operation initiated by send_nw64_ must be completed with a call to the
FILE_AWAITIO64_ procedure.
To determine the number of bytes that are transferred as a result of the send_nw64_ function,
check nb_sent (the first field of the send_nw_str structure). When the send_nw64_ function
completes processing, FILE_AWAITIO64_ returns a pointer to nb_sent as its second
parameter and a count of 2 (the length of nb_sent) as its third parameter. This use of the
FILE_AWAITIO64_ parameters is nonstandard.
For information on checking errors, see Nowait Call Errors (page 86).
Example
The following programming example calls the send_nw64_ routine and checks for the number of
bytes sent:
#include <socket.h>
#include <netdb.h>
...
struct send_nw_str *snw;
int cc, count = bp - &buf [0]; errno = 0;
...
for (bp = &buf [0]; count > 0; count -= cc) {
send_nw64_ (socket, (char _ptr64*)bp, count, 0, 0L);
FILE_AWAITIO64_ (&ret_fd, (char _ptr64 *)&snw, &cc, &ret_tag, 0D, -1);
cc = snw->nb_sent;
if (cc < 0) break;
bp += cc;
};
send_nw2
The send_nw2 function sends data on a connected socket. Unlike the send and send_nw calls,
the send_nw2 call does not store the number of bytes sent in the data buffer. Therefore, the
send_nw2 call does not require the application to allocate 2 bytes in front of its data buffer to
receive the number of bytes sent. Instead, the application should call socket_get_len to obtain
the number of bytes sent.
C Synopsis
#include <socket.h>
#include <netdb.h>
error := send_nw2 (socket, nbuffer_ptr, nbuffer_length,
flags, tag);
send_nw2 173