Skip to content

Instantly share code, notes, and snippets.

@ruedesign
Created March 22, 2013 06:44
Show Gist options
  • Save ruedesign/5219438 to your computer and use it in GitHub Desktop.
Save ruedesign/5219438 to your computer and use it in GitHub Desktop.
ZeroMQ Request sample (Request-Reply Model)
import zmq
context = zmq.Context()
req = context.socket(zmq.REQ)
req.connect("tcp://127.0.0.1:5555")
while True:
c += 1
msg = "%s" % c
req.send(msg)
print "sended request: [%s]" % msg
response = req.recv()
print "recieved response: [%s]" % response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment