summaryrefslogtreecommitdiff
path: root/examples/bench/pyzmq_client.py
blob: 9afccec325e2ed85470bd7a7815c44ace9b3e78c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import zmq

c = zmq.Context()
s = c.socket(zmq.REQ)
s.connect('tcp://127.0.0.1:10001')

def echo(msg):
    s.send(msg, copy=False)
    msg2 = s.recv(copy=False)
    return msg2

class Client(object):
    pass

client = Client()
client.echo = echo