-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.cpp
More file actions
60 lines (59 loc) · 1.36 KB
/
Copy pathconfig.cpp
File metadata and controls
60 lines (59 loc) · 1.36 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
//
// Created by elysia on 3/11/24.
//
#include "config.h"
Config::Config():port{9906},LOGWrite{0},TRIGMode{0},LISTENTrigmode{0},CONNTrigmode{0},OPT_LINGER{0},sql_num{0},
thread_num{0},close_log{0},actor_model{0}{}
void Config::parse_args(int argc,char*argv[])
{
int opt;
const char * str = "p:l:m:o:s:t:c:a:";
while((opt = getopt(argc,argv,str))!=-1)
{
switch (opt)
{
case 'p':
{
port = atoi(optarg);
break;
}
case 'l':
{
LOGWrite = atoi(optarg);
break;
}
case 'm':
{
TRIGMode = atoi(optarg);
break;
}
case 'o':
{
OPT_LINGER = atoi(optarg);
break;
}
case 's':
{
sql_num = atoi(optarg);
break;
}
case 't':
{
thread_num = atoi(optarg);
break;
}
case 'c':
{
close_log = atoi(optarg);
break;
}
case 'a':
{
actor_model = atoi(optarg);
break;
}
default:
break;
}
}
}