Syntax
#include <sys/types.h>
#include <sys/socket.h>
int recv(int socket_descriptor,
char *buffer,
int buffer_length,
int flags)
|
The recv() function is used to receive data through a socket.
Parameters
Return Value
recv() returns an integer. Possible values are:
Error Conditions
When recv() fails, errno can be set to one of the following:
The socket pointed to by the socket_descriptor parameter is using a connection-oriented transport service, and a connect() was previously completed. The process, however, does not have the appropriate privileges to the objects that were needed to establish a connection. For example, the connect() required the use of an APPC device that the process was not authorized to.
This error code indicates that the transport provider ended the connection abnormally because of one of the following:
The system detected an address which was not valid while attempting to access the buffer parameter.
This error code indicates one of the following:
This error code is returned only on sockets that use a connection-oriented transport service.
This error code indicates one of the following:
A nonblocking connect() call was previously done that resulted in the connection establishment timing out. No connection is established. This error code is returned only on sockets that use a connection-oriented transport service.
Error Messages
Usage Notes
Related Information
| Top | Sockets APIs | APIs by category |
| [Information Center Home Page | Feedback ] | [Legal | AS/400 Glossary] |