Skip to content

Instantly share code, notes, and snippets.

@Exchizz
Created May 9, 2016 10:40
Show Gist options
  • Save Exchizz/90c7aae17f0209b63fec12ee91b1b84e to your computer and use it in GitHub Desktop.
Save Exchizz/90c7aae17f0209b63fec12ee91b1b84e to your computer and use it in GitHub Desktop.
import zmq
import time
port = "1337"
context = zmq.Context()
socket = context.socket(zmq.PUB)
socket.bind("tcp://*:%s" % port)
while True:
messagedata = "Test data"
print "sending"
socket.send("%s %s" % ("data_topic", messagedata))
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment