TCP/IP Programming Manual

Usage Guidelines
Use send_nw2_64_ on a socket created for nowait operations. The operation initiated by
send_nw2_64_ 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_nw2_64_
function, call the socket_get_len call.
For the send_nw2_64_ call, complete the request with a call to AWIATIOX64 before issuing
another function call that uses nbuffer_ptr64.
For information on error checking, see Nowait Call Errors (page 86).
Example
The following programming example calls the send_nw2_64_ routine and checks for the number
of bytes sent:
#include <socket.h>
#include <netdb.h>
int s;
...
char *snw;
int cc, count = bp - &buf [0]; errno = 0;
...
for (bp = &buf [0]; count > 0; count -= cc) {
send_nw2_64_ (socket, (char _ptr*)bp, count, 0, 0L);
FILE_AWAITIO64_ (&ret_fd, (char _ptr64*)&snw, &cc, &ret_tag, 0D, -1);
cc = socket_get_len(s);
if (cc < 0) break;
bp += cc;
};
sendto
The sendto function sends data on an unconnected UDP socket or raw socket for waited operations.
C Synopsis
#include <socket.h>
#include <in.h>
#include <in6.h> /* for IPv6 use */
#include <netdb.h>
nsent = sendto (socket, buffer_ptr, buffer_length, flags,
sockaddr_ptr, sockaddr_length);
int nsent, socket;
char *buffer_ptr;
int buffer_length, flags;
struct sockaddr *sockaddr_ptr;
int sockaddr_length;
TAL Synopsis
?NOLIST, SOURCE SOCKDEFT
?NOLIST, SOURCE SOCKPROC
nsent := sendto (socket, buffer_ptr, buffer_length, flags,
sockaddr_ptr, sockaddr_length);
INT(32) socket,
buffer_length,
flags,
sockaddr_length;
STRING .EXT buffer_ptr;
INT .EXT sockaddr_ptr(sockaddr);
sendto 177