Hi everybody;
I am working with the node.js example. I have installed openpgm and zeromq
3.2.3 on my mac osx 10.8.3 machine.
publish code:
var zmq = require('zmq')
, port = 'epgm://192.168.1.100;239.192.1.1:5555';
var socket = zmq.socket('pub');
socket.identity = 'publisher' + process.pid;
var stocks = ['AAPL', 'GOOG', 'YHOO', 'MSFT', 'INTC'];
socket.bind(port, function(err) {
if (err) throw err;
console.log('bound!');
setInterval(function() {
var symbol = stocks[Math.floor(Math.random()*stocks.length)]
, value = Math.random()*1000;
console.log(socket.identity + ': sent ' + symbol + ' ' + value);
socket.send(symbol + ' ' + value);
}, 1000);
});
subscribe code:
var zmq = require('zmq') , port = 'epgm://192.168.1.100;239.192.1.1:5555';
var socket = zmq.socket('sub');
socket.identity = 'subscriber' + process.pid;
socket.connect(port);
socket.subscribe('AAPL'); socket.subscribe('GOOG');
console.log('connected!');
socket.on('message', function(data) { console.log(socket.identity + ':
received data ' + data.toString()); });
Basically the push program just pushes all the messages without any error,
and the pull program starts but doesn't receive any message.
apple@appletekiMacBook-Air:/sources/zeromq$ node pub_pgm.js
epgm://192.168.1.100;239.192.1.1:5555
bound!
sent:appletekiMacBook-Air.local 0
aasent:appletekiMacBook-Air.local 1
sent:appletekiMacBook-Air.local 2
sent:appletekiMacBook-Air.local 3
===========
apple@appletekiMacBook-Air:/sources/zeromq$ node sub_pgm.js
epgm://192.168.1.100;239.192.1.1:5555
3.2.3
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev