forked from yaosj2k/dnsforwarder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
socketpuller.h
executable file
·39 lines (30 loc) · 1.05 KB
/
socketpuller.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef SOCKETPULLER_H_INCLUDED
#define SOCKETPULLER_H_INCLUDED
/** Non-thread-safe socket puller */
#include "socketpool.h"
#include "common.h"
#include "oo.h"
typedef struct _SocketPuller SocketPuller;
struct _SocketPuller{
PRIMEMB SocketPool p;
PRIMEMB fd_set s;
PRIMEMB SOCKET Max;
PUBMEMB int (*Add)(SocketPuller *p,
SOCKET s,
const void *Data,
int DataLength
);
int (*Del)(SocketPuller *p, SOCKET s);
PUBMEMB SOCKET (*Select)(SocketPuller *p,
struct timeval *tv,
void **Data,
BOOL Reading,
BOOL Writing
);
PUBMEMB BOOL (*IsEmpty)(SocketPuller *p);
PUBMEMB void (*CloseAll)(SocketPuller *p, SOCKET ExceptFor);
PUBMEMB void (*Free)(SocketPuller *p);
PUBMEMB void (*FreeWithoutClose)(SocketPuller *p);
};
int SocketPuller_Init(SocketPuller *p);
#endif // SOCKETPULLER_H_INCLUDED