Skip to content

Instantly share code, notes, and snippets.

@berry
Created July 10, 2010 16:45
Show Gist options
  • Save berry/470849 to your computer and use it in GitHub Desktop.
Save berry/470849 to your computer and use it in GitHub Desktop.
0MQ request response test against a Redis server
# Code below doesn't work. It keeps waiting for a response.
import zmq
ctx = zmq.Context()
s = ctx.socket(zmq.REQ)
# On port 6379 there is a basic REDIS server
s.connect("tcp://127.0.0.1:6379")
s.send('*1\r\n$4\r\nPING\r\n')
print s.recv()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment