IPX/SPX Programming Manual

Library Routines
HP NonStop IPX/SPX Programming Manual528022-001
5-32
recv, recv_nw
recv,
recv_nw
The recv and recv_nw functions receive data on a connected socket.
nrcvd
is the number of bytes received by the recv function. This is the return value for
recv. A zero length message indicates end of file (EOF).
If the call is not successful, -1 is returned and the external variable errno is set as
indicated below in “Errors.”
error
is the 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 below in “Errors.”
socket
specifies the socket number for the socket, as returned by the call to socket or
socket_nw.
C Synopsis
#include <socket.h>
#include <netdb.h>
nrcvd = recv (socket, buffer_ptr, length, flags);
error = recv_nw (socket, buffer_ptr, length, flags, tag);
int nrcvd, socket, length, flags, error;
char *buffer_ptr;
long tag;
TAL Synopsis
?NOLIST, SOURCE SOCKDEFT
?NOLIST, SOURCE SOCKPROC
nrcvd := recv (socket, buffer_ptr, length, flags);
error := recv_nw (socket, buffer_ptr, length, flags, tag);
INT socket,
length,
flags;
STRING .EXT buffer_ptr;
INT(32)tag;