-
typedef struct {
-
char host[64]; /* Host name */
-
ringq_t inBuf; /* Input ring queue */
-
ringq_t outBuf; /* Output ring queue */
-
ringq_t lineBuf; /* Line ring queue */
-
socketAccept_t accept; /* Accept handler */
-
socketHandler_t handler; /* User I/O handler */
-
int handler_data; /* User handler data */
-
int handlerMask; /* Handler events of interest */
-
int sid; /* Index into socket[] */
-
int port; /* Port to listen on */
-
int flags; /* Current state flags */
-
int sock; /* Actual socket handle */
-
int fileHandle; /* ID of the file handler */
-
int interestEvents; /* Mask of events to watch for */
-
int currentEvents; /* Mask of ready events (FD_xx) */
-
int selectEvents; /* Events being selected */
-
int saveMask; /* saved Mask for socketFlush */
-
int error; /* Last error */
-
} socket_t;
typedef void (*socketHandler_t)(int sid, int mask, int data);
typedef int (*socketAccept_t)(int sid, char *ipaddr, int port,
int listenSid);