-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver_main.cpp
More file actions
35 lines (30 loc) · 773 Bytes
/
Copy pathserver_main.cpp
File metadata and controls
35 lines (30 loc) · 773 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 <iostream>
#include <set>
#include <string>
#include "weight_raft/server.h"
#include "weight_raft/utils.h"
using namespace std;
using namespace weight_raft;
int main(int argc, char* args[]) {
if (argc != 4) {
cout << "client <datapath> <all_ipaddresses> <my_ipaddress>" << endl;
return -1;
}
int port = 1088;
string datapath = string(args[1]);
set<string> ips = parse_nodes(string(args[2]));
WeightServer* server_ptr = new WeightServer(datapath, ips, port, args[3], args[3]);
server_ptr->start();
// server_ptr->start();
int count = 0;
while (!brpc::IsAskedToQuit()) {
sleep(2);
cout << "." << std::flush;
count++;
if (count == 5) {
cout << endl;
cout << "running" << std::flush;
}
}
return 0;
}