diff options
Diffstat (limited to 'contrib/zeromq/test-client.py')
-rwxr-xr-x | contrib/zeromq/test-client.py | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/contrib/zeromq/test-client.py b/contrib/zeromq/test-client.py index 1886d9cab..753b132d8 100755 --- a/contrib/zeromq/test-client.py +++ b/contrib/zeromq/test-client.py @@ -9,28 +9,28 @@ import storage.Storage def main(args): - endpoint = "tcp://127.0.0.1:9090" - socktype = zmq.REQ - incr = 0 - if len(args) > 1: - incr = int(args[1]) - if incr: - socktype = zmq.DOWNSTREAM - endpoint = "tcp://127.0.0.1:9091" + endpoint = "tcp://127.0.0.1:9090" + socktype = zmq.REQ + incr = 0 + if len(args) > 1: + incr = int(args[1]) + if incr: + socktype = zmq.DOWNSTREAM + endpoint = "tcp://127.0.0.1:9091" - ctx = zmq.Context() - transport = TZmqClient.TZmqClient(ctx, endpoint, socktype) - protocol = thrift.protocol.TBinaryProtocol.TBinaryProtocolAccelerated(transport) - client = storage.Storage.Client(protocol) - transport.open() + ctx = zmq.Context() + transport = TZmqClient.TZmqClient(ctx, endpoint, socktype) + protocol = thrift.protocol.TBinaryProtocol.TBinaryProtocolAccelerated(transport) + client = storage.Storage.Client(protocol) + transport.open() - if incr: - client.incr(incr) - time.sleep(0.05) - else: - value = client.get() - print value + if incr: + client.incr(incr) + time.sleep(0.05) + else: + value = client.get() + print value if __name__ == "__main__": - main(sys.argv) + main(sys.argv) |