blob: 6b0eef1562a917720820514bb186e4ae5fd04f22 [file] [log] [blame]
David Reiss9f3296b2010-08-31 16:58:41 +00001#include <iostream>
2#include <cstdlib>
Roger Meier49ff8b12012-04-13 09:12:31 +00003#include <thrift/protocol/TBinaryProtocol.h>
David Reiss9f3296b2010-08-31 16:58:41 +00004
5#include "zmq.hpp"
6#include "TZmqClient.h"
7#include "Storage.h"
8
9using boost::shared_ptr;
10using apache::thrift::transport::TZmqClient;
11using apache::thrift::protocol::TBinaryProtocol;
12
13int 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}