Skip to content

Instantly share code, notes, and snippets.

@jdiez17
Created December 7, 2014 13:06
Show Gist options
  • Select an option

  • Save jdiez17/ad01c0e78d257df232ef to your computer and use it in GitHub Desktop.

Select an option

Save jdiez17/ad01c0e78d257df232ef to your computer and use it in GitHub Desktop.
var zmq = require("zmq");
sock = zmq.socket("sub");
sock.connect("ipc:///tmp/keypad.zmq");
sock.on("message", function(msg) {
console.log(msg);
});
#!/usr/bin/env python
import zmq
import sys
ctx = zmq.Context()
pub = ctx.socket(zmq.PUB)
pub.bind("ipc://" + sys.argv[1])
if __name__ == '__main__':
while True:
try:
msg = input("> ")
pub.send_string(msg)
except:
sys.exit(0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment