title: Emit multiple messages socket.io from one open connection
body: <p>I am new to socket.io, and trying to figure out how to send multiple messages. Here is the scenario I am working on,</p>
  
  <pre><code>function setupServer(server) {
      var socketIO = require("socket.io").listen(server);
      socketIO.sockets.on('connection', function (socket) {
          console.log("client is connected");
          socket.emit('update', { progress: "starting..." })
      });
  }
  </code></pre>
  
  <p>I have to call setupServer(server) from another method, and I am receiving "starting..." on client side.</p>
  
  <p>But the problem is, i want to send more/multiple messages LATER ON. Can not send array of messages as my application is building messages strings in say every 10 milliseconds (in a callback function) and i want to send as soon as they are created.</p>
  
  <p>Any solution? Is it possible to get the socket object reference to reuse outside this function?</p>