testserver.c
731 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
37
38
#include <stdio.h>
#include <socket.h>
#include <string.h>
#include <sys/time.h>
#include <sys/resource.h>
#include "server.h"
#include "logger.h"
#include "http/request_parser.h"
#include "signalHandling.h"
#include "interface/class.h"
int
main()
{
struct rlimit limit = {RLIM_INFINITY, RLIM_INFINITY};
Logger logger = new(LoggerStderr, LOGGER_ERR);
HttpRequestParser parser = new(HttpRequestParser);
Server server = new(Server, logger, parser, 11212, SOMAXCONN);
//Server server = new(Server, logger, parser, 11212, 20);
setrlimit(RLIMIT_CPU, &limit);
init_signals();
serverRun(server);
delete(&server);
delete(&logger);
delete(&parser);
return 0;
}
// vim: set ts=4 sw=4: