Skip to content

Instantly share code, notes, and snippets.

@mitsuhiko
Created June 18, 2012 10:47
Show Gist options
  • 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