-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGlobal.hpp
47 lines (39 loc) · 855 Bytes
/
Global.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
#pragma once
#ifndef _GLOBAL_HPP_
#define _GLOBAL_HPP_
#include <iostream>
#include <tuple>
#include <unordered_map>
#include <algorithm>
#include <vector>
#include <mutex>
#include <atomic>
#include <thread>
#include <string>
#include <memory>
#include <csignal>
#include <cstring>
#include "Pack.hpp"
#include "CELLTimestamp.hpp"
#ifdef _WIN32
#define FD_SETSIZE 512
#include <WinSock2.h>
#include <Windows.h>
#else//Linux
#include <unistd.h>
#include <arpa/inet.h>
#define SOCKET int
#define INVALID_SOCKET (SOCKET)(~0)
#define SOCKET_ERROR (-1)
#endif
#define CMD_ERROR 0
#define CMD_SUCCESS 1
#define CLIENT_ERROR -1
#define CLIENT_SUCCESS 1
#define CLIENT_DISCONNECT -1
#define SEND_BUF_SIZE 20480
#define RECV_BUF_SIZE 4096
#define MSG_BUF_SIZE 20480
#define CLIENT_HEART_DEAD_TIME 10000
#define SERVER_SEND_TIME 200
#endif