forked from uroni/urbackup_backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AcceptThread.h
44 lines (32 loc) · 856 Bytes
/
AcceptThread.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
40
41
42
43
44
#include <vector>
#include "socket_header.h"
#include "types.h"
#include "libfastcgi/fastcgi.hpp"
class CSelectThread;
class CClient;
class CAcceptThread
{
public:
CAcceptThread(unsigned int nWorkerThreadsPerMaster, unsigned short int uPort);
~CAcceptThread();
void operator()(bool single=false);
bool has_error(void);
private:
void AddToSelectThread(CClient *client);
bool init_socket_v4(unsigned short port);
bool init_socket_v6(unsigned short port);
std::vector<CSelectThread*> SelectThreads;
SOCKET s;
SOCKET s_v6;
unsigned int WorkerThreadsPerMaster;
bool error;
};
class OutputCallback : public FCGIProtocolDriver::OutputCallback
{
public:
virtual ~OutputCallback();
OutputCallback(SOCKET fd_);
virtual void operator() (const void* buf, size_t count);
private:
SOCKET fd;
};