-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathproxy.c
More file actions
36 lines (27 loc) · 653 Bytes
/
Copy pathproxy.c
File metadata and controls
36 lines (27 loc) · 653 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
#include "include.h"
size_t MAX_PROXY_THREADS = 10;
int main(int argc, char** argv) {
int port, shared_memory;
struct sigaction sa;
sa.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &sa, NULL);
struct sigaction sac;
sac.sa_handler = pc_kill;
sigaction(SIGINT, &sac, NULL);
if( argc < 4 ) {
fprintf(stderr, "Not enough arguments!\n");
exit(1);
}
port = atoi(argv[1]);
MAX_PROXY_THREADS = atoi(argv[2]);
shared_memory = ( !strcmp(argv[3], "shared") ) ? 1 : 0;
if(shared_memory) {
printf("Running in shared memory mode\n");
}
else {
printf("Running in socket mode\n");
}
pc_start(port, shared_memory);
pc_stop();
return 0;
}