]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
1 | #include <iostream> |
2 | #include <cstdlib> | |
3 | #include <thrift/protocol/TBinaryProtocol.h> | |
4 | ||
5 | #include "zmq.hpp" | |
6 | #include "TZmqClient.h" | |
7 | #include "Storage.h" | |
8 | ||
9 | using apache::thrift::std::shared_ptr; | |
10 | using apache::thrift::transport::TZmqClient; | |
11 | using apache::thrift::protocol::TBinaryProtocol; | |
12 | ||
13 | int main(int argc, char** argv) { | |
14 | const char* endpoint = "epgm://eth0;239.192.1.1:5555"; | |
15 | int socktype = ZMQ_PUB; | |
16 | int incr = 1; | |
17 | if (argc > 1) { | |
18 | incr = atoi(argv[1]); | |
19 | } | |
20 | ||
21 | zmq::context_t ctx(1); | |
22 | shared_ptr<TZmqClient> transport(new TZmqClient(ctx, endpoint, socktype)); | |
23 | shared_ptr<TBinaryProtocol> protocol(new TBinaryProtocol(transport)); | |
24 | StorageClient client(protocol); | |
25 | ||
26 | transport->open(); | |
27 | ||
28 | client.incr(incr); | |
29 | usleep(50000); | |
30 | ||
31 | return 0; | |
32 | } |