Skip to content

Instantly share code, notes, and snippets.

@saghul
Created June 25, 2011 21:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save saghul/1046944 to your computer and use it in GitHub Desktop.
Save saghul/1046944 to your computer and use it in GitHub Desktop.
ZMQ multicast producer example
# producer
import zmq
context = zmq.Context()
socket = context.socket(zmq.PUB)
socket.setsockopt(zmq.LINGER, 0) # discard unsent messages on close
socket.connect('epgm://239.192.1.1:5000')
while True:
msg = raw_input('> ')
if msg == 'quit':
break
else:
socket.send(msg)
socket.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment