-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
55 lines (43 loc) · 1.66 KB
/
Copy pathmain.cpp
File metadata and controls
55 lines (43 loc) · 1.66 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
#include <iostream>
#include <cstdlib>
#include "server.h"
#include "debug.h"
using std::cout;
using std::endl;
using std::uint16_t;
using std::atoi;
int main(int argc, char *argv[])
{
if(argc != 2)
{
cout << "usage: " << argv[0] << " <port>" << endl;
return 1;
}
cout << endl;
cout << " *** ****** *** *** *** " << endl;
cout << " * * * ** ** * * " << endl;
cout << " * * * ** ** * * " << endl;
cout << " * * * ** ** * * " << endl;
cout << " * * * ** ** * * " << endl;
cout << " * ***** ** ** * * " << endl;
cout << " * * * * * * * " << endl;
cout << " * * * * * * * " << endl;
cout << " * * * * * * ** * " << endl;
cout << " * * * * * * * ** " << endl;
cout << " ******* *** ** * ** *** " << endl;
cout << " ** " << endl;
cout << endl;
uint16_t port = atoi(argv[1]);
if(port < 1024)
{
LOG_ERR("Ports 0~1023 are system ports,please choice another ports.");
return 1;
}
LOG_INFO("Starting lpmqd with port " << port);
Server lpmqd(port);
if(!lpmqd.exec())
{
LOG_INFO("lpmqd exit!");
}
return 0;
}