Checking in vendor folder for ease of using go get.
This commit is contained in:
parent
7a1251853b
commit
cdb4b5a1d0
3554 changed files with 1270116 additions and 0 deletions
40
vendor/git.apache.org/thrift.git/contrib/zeromq/test-client.cpp
generated
vendored
Normal file
40
vendor/git.apache.org/thrift.git/contrib/zeromq/test-client.cpp
generated
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <thrift/protocol/TBinaryProtocol.h>
|
||||
|
||||
#include "zmq.hpp"
|
||||
#include "TZmqClient.h"
|
||||
#include "Storage.h"
|
||||
|
||||
using boost::shared_ptr;
|
||||
using apache::thrift::transport::TZmqClient;
|
||||
using apache::thrift::protocol::TBinaryProtocol;
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
const char* endpoint = "tcp://127.0.0.1:9090";
|
||||
int socktype = ZMQ_REQ;
|
||||
int incr = 0;
|
||||
if (argc > 1) {
|
||||
incr = atoi(argv[1]);
|
||||
if (incr) {
|
||||
socktype = ZMQ_DOWNSTREAM;
|
||||
endpoint = "tcp://127.0.0.1:9091";
|
||||
}
|
||||
}
|
||||
|
||||
zmq::context_t ctx(1);
|
||||
shared_ptr<TZmqClient> transport(new TZmqClient(ctx, endpoint, socktype));
|
||||
shared_ptr<TBinaryProtocol> protocol(new TBinaryProtocol(transport));
|
||||
StorageClient client(protocol);
|
||||
transport->open();
|
||||
|
||||
if (incr) {
|
||||
client.incr(incr);
|
||||
usleep(50000);
|
||||
} else {
|
||||
int value = client.get();
|
||||
std::cout << value << std::endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue