TCP/IP Programming Manual
...
tosend = sizeof(buffer);
status = recv64_(rsock, (char _ptr64*)&buffer[0], tosend, 0);
recvfrom
The recvfrom function receives data on an unconnected UDP socket or raw socket created for
waited operations.
C Synopsis
#include <socket.h>
#include <in.h>
#include <in6.h> /* for IPv6 use */
#include <netdb.h>
nrcvd = recvfrom (socket, buffer_ptr, buffer_length, flags,
from_ptr, from_length);
int nrcvd, socket;
char *buffer_ptr;
int buffer_length, flags;
struct sockaddr * from_ptr;
int *from_length;
TAL Synopsis
?NOLIST, SOURCE SOCKDEFT
?NOLIST, SOURCE SOCKPROC
nrcvd := recvfrom (socket, buffer_ptr, buffer_length, flags,
from_ptr, from_length);
INT(32) nrcvd,
socket;
STRING .EXT buffer_ptr;
INT(32) buffer_length,
flags;
INT .EXT from_ptr(sockaddr_in);
INT .EXT from_length;
nrcvd
return value; the number of bytes received. This is the return value.
If the call is not successful, —1 is returned, and the external variable errno is set as indicated
in Errors (page 159).
socket
input value; specifies the socket number for the socket, as returned by the call to the socket
function.
buffer_ptr
input value; on return, points to the received data.
buffer_length
input value; the size of the buffer pointed to by buffer_ptr.
flags
input value; specifies how the message is read, and is one of the following messages:
Read the incoming message without removing it from the queue.MSG_PEEK
No flag; read incoming message normally.0
158 Library Routines