src/sock.h
branchnew-transport
changeset 155 c59d3eaff0fb
parent 154 f4472119de3b
child 180 22967b165692
equal deleted inserted replaced
154:f4472119de3b 155:c59d3eaff0fb
     9 #include "error.h"
     9 #include "error.h"
    10 #include <sys/types.h>
    10 #include <sys/types.h>
    11 #include <event2/event.h>
    11 #include <event2/event.h>
    12 
    12 
    13 /**
    13 /**
    14  * Socket function error codes
       
    15  */
       
    16 enum sock_error_code {
       
    17     _ERR_SOCK_BEGIN = _ERR_SOCK,
       
    18     ERR_SOCKET,         ///< socket(2) failed
       
    19     ERR_CONNECT,        ///< connect(2) error - either direct or async
       
    20     ERR_READ,           ///< read(2) error - will probably show up as an ERR_WRITE as well
       
    21     ERR_READ_EOF,       ///< EOF on read(2)
       
    22     ERR_WRITE,          ///< write(2) error - data was unsent, will probably show up as an ERR_READ as well
       
    23     ERR_WRITE_EOF,      ///< write(2) gave EOF - zero bytes written
       
    24     ERR_FCNTL,          ///< fcntl(2) failed
       
    25     ERR_CLOSE,          ///< close(2) failed, some written data was probably not sent
       
    26     ERR_GETSOCKOPT,     ///< getsockopt(2) failed
       
    27     ERR_OPEN,           ///< open(2) failed
       
    28 };
       
    29 
       
    30 /**
       
    31  * Initialize the socket module's global state. Call this before calling any other sock_* functions.
    14  * Initialize the socket module's global state. Call this before calling any other sock_* functions.
    32  *
    15  *
    33  * The given \a ev_base is the libevent base to use for nonblocking operation.
    16  * The given \a ev_base is the libevent base to use for nonblocking operation.
    34  *
    17  *
    35  * @param ev_base the libevent base to use for events
    18  * @param ev_base the libevent base to use for events