Provided by: liblcgdm-dev_1.13.0-1_amd64
netread - receive a message from a socket
#include "net.h" int netread (int s, char *buf, int nbytes); ssize_t netread_timeout (int s, void *buf, size_t nbytes, int timeout);
netread receives a message from a socket. It overcomes the message fragmentation problem and always waits for all requested bytes to arrive or a timeout/error occurs.
This routine returns the number of bytes if the operation was successful, 0 if the connection was closed by the remote end or -1 if the operation failed. In the latter case, serrno is set appropriately.
EINTR The function was interrupted by a signal. EBADF s is not a valid descriptor. EAGAIN The socket is non-blocking and there is no message available. EFAULT buf is not a valid pointer. EINVAL nbytes is negative or zero. ENOTSOCK s is not a socket. SECONNDROP Connection closed by remote end. SETIMEDOUT Timed out.
LCG Grid Deployment Team