TCP/IP Programming Manual
?NOLIST, SOURCE SOCKDEFT
?NOLIST, SOURCE SOCKPROC
error := recvfrom_nw (socket, r_buffer_ptr, length,
flags, tag );
INT socket,
length,
flags;
INT .EXT r_buffer_ptr(sendto_recvfrom_buf);
INT(32) tag;
error
return value; if the call is successful, a zero is returned. If the call is not successful, –1 is returned.
If the call failed, the external variable errno is set as indicated in Errors (page 202).
socket
input value; specifies the socket number for the socket, as returned by the call to socket_nw.
r_buffer_ptr
input and return value; on completion, points to the remote address and port number from
which the data is received, followed by the data. The address of the data is (r_buffer_ptr
+ sizeof(struct sockaddr_in)), where sizeof(struct sockaddr_in) is 16
bytes.
length
input value; the size of the buffer pointed to by r_buffer_ptr. The size of the buffer is the
size of the data plus sizeof(struct sockaddr_in), where sizeof(struct
sockaddr_in) is 16 bytes.
flags
input value; specifies how the incoming message is to be read, and is one of the following
values:
Read the incoming message without removing the message from the queue.MSG_PEEK
No flag; read data normally.0
tag
is the tag parameter to be used for the nowait operation initiated by t_recvfrom_nw.
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 nowait call; it must be completed with a call to the AWAITIOX procedure. For a
waited call, use recvfrom.
• The parameters of the t_recvfrom_nw function are not compatible with those of the
recvfrom function in the 4.3 BSD UNIX operating system.
202 Library Routines