Created
December 7, 2014 13:06
-
-
Save jdiez17/ad01c0e78d257df232ef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var zmq = require("zmq"); | |
| sock = zmq.socket("sub"); | |
| sock.connect("ipc:///tmp/keypad.zmq"); | |
| sock.on("message", function(msg) { | |
| console.log(msg); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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