netread man page

NETREAD(3)                 Common Library Functions                 NETREAD(3)

[1mNAME[0m
      netread - receive a message from a socket

[1mSYNOPSIS[0m
      [1m#include "net.h"[0m

      [1mint netread (int [4m[22ms[24m[1m, char *[4m[22mbuf[24m[1m, int [4m[22mnbytes[24m[1m);[0m

      [1mssize_t netread_timeout (int [4m[22ms[24m[1m, void *[4m[22mbuf[24m[1m, size_t [4m[22mnbytes[24m[1m, int [4m[22mtimeout[24m[1m);[0m

[1mDESCRIPTION[0m
      [1mnetread  [22mreceives  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.

[1mRETURN VALUE[0m
      This  routine returns the number of bytes if the operation was success-
      ful, 0 if the connection was closed by the remote  end  or  -1  if  the
      operation failed. In the latter case, [1mserrno [22mis set appropriately.

[1mERRORS[0m
      [1mEINTR       [22mThe function was interrupted by a signal.

      [1mEBADF       [4m[22ms[24m is not a valid descriptor.

      [1mEAGAIN      [22mThe  socket  is non-blocking and there is no message avail-
                  able.

      [1mEFAULT      [4m[22mbuf[24m is not a valid pointer.

      [1mEINVAL      [4m[22mnbytes[24m is negative or zero.

      [1mENOTSOCK    [4m[22ms[24m is not a socket.

      [1mSECONNDROP  [22mConnection closed by remote end.

      [1mSETIMEDOUT  [22mTimed out.

[1mSEE ALSO[0m
      [1mrecv(2)[22m, [1mneterror(3)[0m

[1mAUTHOR[0m
      [1mLCG Grid Deployment [22mTeam

LCG                      $Date: 2005/03/29 09:27:19 $               NETREAD(3)