forked from sbshrey/DiPETrans
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmasterClient.cpp
More file actions
44 lines (33 loc) · 1.08 KB
/
masterClient.cpp
File metadata and controls
44 lines (33 loc) · 1.08 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
#include <iostream>
#include <vector>
//#include "json_spirit/ciere/json/value.hpp"
#include "nlohmann/json.hpp"
#include <fstream>
#include <cstdlib>
#include <thrift/protocol/TBinaryProtocol.h>
#include <thrift/transport/TSocket.h>
#include <thrift/transport/TTransportUtils.h>
#include "Logger.h"
#include "gen-cpp/MasterService.h"
#include "gen-cpp/SharedService.h"
//#include "gen-cpp/WorkerService.h"
using namespace std;
using namespace apache::thrift;
using namespace apache::thrift::protocol;
using namespace apache::thrift::transport;
using json = nlohmann::json;
using namespace ::MasterService;
using namespace ::SharedService;
string MSG="MasterClient";
//192.168.0.11
int main(int argc, char const *argv[]) {
int port = atoi(argv[1]);
std::shared_ptr<TTransport> socket(new TSocket("192.168.0.11", port));
std::shared_ptr<TTransport> transport(new TBufferedTransport(socket));
std::shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));
MasterServiceClient client(protocol);
transport->open();
client.processBlocks();
transport->close();
return 0;
}