TCP/IP Programming Manual

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
from_ptr64
input and return value; on return, points to the remote address and port number (based on the
structure sockaddr_in or sockaddr_in6) from which the data is received.
from_length64
input and return value; maintained only for compatibility and must point to a value indicating
the size in bytes of the structure (the remote address and port number) that from_ptr64 points
to.
Errors
If an error occurs, the return value is set to –1, and the external variable errno is set to one of
the following values:
The specified socket was connected.EISCONN
The specified socket was shut down.ESHUTDOWN
An invalid argument was specified.EINVAL
Usage Guidelines
This is a waited call; your program pauses until the operation completes. For more information,
see Usage Guidelines (page 155) in recv, recv_nw.
You can perform a nowait call to receive data on an unconnected UDP socket or raw socket
using recvfrom_nw64_, described in recvfrom_nw64_ (page 164) call.
Declare the from_ptr64 variable as struct sockaddr_in6 * for IPv6 use or as struct
sockaddr_storage * for protocol-independent use. In C, when you make the call, cast
the variable to sockaddr. (See the IPv6 example.)
Example
INET: the following programming example calls the recvfrom64_ function. In this example,
rsock is a socket created by a previous call to socket and fhost is a structure that receives
the address of the host from which the data is received. The data is received in buffer:
#include <socket.h>
#include <in.h>
#include <netdb.h>
...
struct sockaddr_in fhost;
int status, tosend, len, rsock;
char buffer [8*1024];
...
tosend = sizeof(buffer);
status = recvfrom64_(rsock, (char _ptr64*)&buffer, tosend,
0, (struct sockaddr _ptr64*)&fhost, &(int _ptr64*)&len);
recvfrom_nw
The recvfrom_nw function receives data on an unconnected UDP socket or raw socket created
for nowait operations.
C Synopsis
recvfrom_nw 161