forked from ZX-Pluto/Yazi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
34 lines (26 loc) · 773 Bytes
/
main.cpp
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
#include <iostream>
using namespace std;
#include "IniFile.h"
#include "Singleton.h"
#include "System.h"
using namespace yazi::utility;
#include "Server.h"
using namespace yazi::server;
int main() {
System* sys = Singleton<System>::instance();
sys->init();
IniFile* ini = Singleton<IniFile>::instance();
const string& ip = (*ini)["server"]["ip"];
int port = (*ini)["server"]["port"];
int threads = (*ini)["server"]["threads"];
int max_conn = (*ini)["server"]["max_conn"];
int wait_time = (*ini)["server"]["wait_time"];
ini->show();
Server* server = Singleton<Server>::instance();
server->set_threads(threads);
server->set_connects(max_conn);
server->set_wait_time(wait_time);
server->listen(ip, port);
server->start();
return 0;
}