-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathServer.hpp
58 lines (40 loc) · 1.04 KB
/
Server.hpp
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef Server_hpp
#define Server_hpp
#include <sys/socket.h>
#include <sys/un.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <poll.h>
#include <thread>
#include "Global.hpp"
#include "Constant.hpp"
#include "Configuration.hpp"
#include "ClientHandler.hpp"
#include "ASProcessHandler.hpp"
#include "ResultProcessor.hpp"
class Server : private Configuration, private ResultProcessor, private ASProcessHandler, private ClientHandler {
public:
Server();
~Server();
void init();
void setupSocket();
void setupPoll();
void ServerLoop();
void acceptClient();
void setTerminationHandler();
static void terminate(int);
void setupSharedMemory();
private:
string SocketListenAddress;
uint SocketListenPort;
struct sockaddr_in SocketAddr;
struct sockaddr_in ClientSocketAddr;
int ServerSocketFD;
struct pollfd ServerConnFD[1];
void* _SHMStaticFS;
void* _SHMPythonASMeta;
void* _SHMPythonASRequests;
void* _SHMPythonASResults;
};
#endif