The recv
function is declared in the header file
`sys/socket.h'. If your flags argument is zero, you can
just as well use read
instead of recv
; see section Input and Output Primitives.
recv
function is like read
, but with the additional
flags flags. The possible values of flags are described
In section Socket Data Options.
If nonblocking mode is set for socket, and no data is available to
be read, recv
fails immediately rather than waiting. See section File Status Flags, for information about nonblocking mode.
This function returns the number of bytes received, or -1
on failure.
The following errno
error conditions are defined for this function:
EBADF
ENOTSOCK
EWOULDBLOCK
recv
blocks until there is input
available to be read.)
EINTR
ENOTCONN
Go to the first, previous, next, last section, table of contents.