-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
36 lines (33 loc) · 777 Bytes
/
Copy pathmain.cpp
File metadata and controls
36 lines (33 loc) · 777 Bytes
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
#include "Parser.hpp"
#include "Socket.hpp"
#include "Connection.hpp"
#include "./utils/Tools.hpp"
#include <sys/time.h>
#include "WebServer.hpp"
#include <sys/types.h>
#include <sys/select.h>
#include <cerrno>
// # define BUFFER_SIZE 4096
int main(int ac , char *av[])
{
(void)ac;
(void)av;
try{
Parser pars(ac, av);
std::vector < Server > servers = pars.getServers();
pars.debug();
Connection connection(pars.getMapServers());
Webserver ws(connection);
ws.RunWebServer();
}
catch(std::string er)
{
std::cout << er << std::endl;
}
catch(const char * er)
{
std::cout << er << std::endl;
}
return 0;
//TODO check hostname if there is multiple servers per port
}