Skip to content

Instantly share code, notes, and snippets.

@mitsuhiko
Created June 18, 2012 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mitsuhiko/2947843 to your computer and use it in GitHub Desktop.
Save mitsuhiko/2947843 to your computer and use it in GitHub Desktop.
import zmq
import time
ctx = zmq.Context()
socket = ctx.socket(zmq.REQ)
socket.connect('tcp://127.0.0.1:5000')
print 'Sending auth information'
socket.send('auth')
print 'Response:', socket.recv()
import zmq
import time
ctx = zmq.Context()
socket = ctx.socket(zmq.REP)
socket.bind('tcp://*:5000')
auth_info = socket.recv()
time.sleep(10)
socket.send('authorized')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment