IPX/SPX Programming Manual
Library Routines
HP NonStop IPX/SPX Programming Manual—528022-001
5-34
recv, recv_nw
•
The sending side of a connection indicates end-of-file by closing or shutting down
its socket. The receiving side recognizes end-of-file when the recv or recvfrom
calls have 0 bytes in their length-of-buffer field. This is standard practice, not
specific to HP’s socket library implementation. You are responsible for handling this
condition.
For information about error checking, see Nowait Call Errors on page 5-5.
Example
The following programming example calls the recv function. (In the example, rsock
is a socket created by a previous call to socket):
#include <socket.h>
#include <netdb.h>
...
int status, tosend;
char buffer [8*1024];
...
tosend = sizeof(buffer);
status = recv(rsock, (char *)&buffer[0], tosend, 0);