-
-
Save jfd/4183916c432d4ba32a5a to your computer and use it in GitHub Desktop.
Error in zmq-bindings for Node.js.
This file contains 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 NO = 383; | |
var zmq = require("zeromq"); | |
var socket = zmq.createSocket("pub"); | |
socket.bind("tcp://127.0.0.1:9000", function() {}); | |
setInterval(function() { | |
var b = new Buffer(4); | |
b[0] = NO >>> 24; | |
b[1] = NO >>> 16; | |
b[2] = NO >>> 8; | |
b[3] = NO % 256; | |
socket.send(b); | |
}, 1000); |
This file contains 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 NO = 383; | |
var zmq = require("zeromq"); | |
var b = new Buffer(4); | |
b[0] = NO >>> 24; | |
b[1] = NO >>> 16; | |
b[2] = NO >>> 8; | |
b[3] = NO % 256; | |
var socket = zmq.createSocket("sub"); | |
socket.connect("tcp://127.0.0.1:9000"); | |
socket.subscribe(b.toString("binary")); | |
socket.on("message", function(msg) { | |
console.log(msg); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment