IPX/SPX Programming Manual

Library Routines
HP NonStop IPX/SPX Programming Manual528022-001
5-44
send_nw2
char *snw;
int cc, count = bp - &buf [0]; errno = 0;
...
for (bp = &buf [0]; count > 0; count -= cc) {
send_nw2 (socket, bp, count, 0, 0L);
AWAITIOX (&ret_fd, (char *)&snw, &cc, &ret_tag, -1L);
cc = socket_get_len(s);
if (cc < 0) break;
bp += cc;
};
Before the call to send_nw2, the program creates a socket. The socket number is
saved in the variable socket. The pointer bp points to the data to be sent. The length
of the buffer is count. After the return from AWAITIOX, the program sets cc to the
number of bytes sent by a call to the socket_get_len function.