title: socket.io not working inside zmq function
body: <p>i am putting socketio inside zmq but its not working below is the code
  not sure what i am doing wrong</p>
  
  <pre><code>var io = require('socket.io').listen(2939);
  var zmq = require('zmq');
  var socket = zmq.socket('sub');
  
  console.log("Connecting to Currency Stream....");
  
  socket.subscribe("");
  
      socket.on('message', function (data){
      //console.log(data.toString());
      io.sockets.on('connection', function(socket){
          console.log("In socket.io");
          console.log(data.toString());
          socket.emit("live_rates",
                {date: data[0], time: data[1], 
                      open: data[2], high: data[3], 
                          low: data[4], close: data[5]});
          socket.emit("news", {hello: 'world'});
          console.log("emitted");
      }); 
  });  
  
      socket.connect('tcp://localhost:3191');
  </code></pre>
  
  <p>code inside io.socket.on is not running, handshake is successful as i can see in the log window. when i am putting the code inside zmq (uncomment //console.log(data.toString()); )
  it's showing the data.</p>
  
  <p>what i am really doing here is getting the data from zmq server on a zmq tcp port 3191 and forward it to socket.io http port 2939, then getting the data on browser by connecting to port 2939 using an html page. i do not wish to use zmq on client side as socket.io is much robust for that play.</p>
  
  <p>also a separate socket.io connection ie io.sockets.on is working but inside a zmq socket it fails!</p>
  
  <p>any one</p>
  
  <p>zishan</p>