[zeromq-dev] zmq nodejs epgm can't work on mac osx 10.8.3

yang tao yangtao.com.cn at gmail.com
Mon Jul 29 16:51:39 CEST 2013


 



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 at 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 at appletekiMacBook-Air:/sources/zeromq$ node sub_pgm.js 

epgm://192.168.1.100;239.192.1.1:5555


3.2.3


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130729/200613a6/attachment.htm>


More information about the zeromq-dev mailing list