title: multiple handshakes on socket.io connect
body: <p>I am writing the server for a mobile application and have chosen to use socket.io for push notifications from the server to the app but I am having trouble setting up socket.io</p>
  
  <p>There is currently an endless stream of handshakes being initiated upon io.connect(server:port)</p>
  
  <pre><code>debug - client authorized
  info  - handshake authorized HXtC1UPzcsEzO8X7x2B1
  debug - client authorized
  info  - handshake authorized aE7hMGDpp5InO1UWx2B2
  debug - client authorized
  info  - handshake authorized GBx_3n-8Lvbuo4QJx2B3
  debug - client authorized
  info  - handshake authorized tOEl0F5wNlh4xkn1x2B4
  debug - client authorized
  info  - handshake authorized K55Oit22yN9JDWxhx2B5
  debug - client authorized
  ...
  </code></pre>
  
  <p>I am using socket.io-titanium for the client-side of the application and I cannot tell which end is causing this connection issue.</p>
  
  <p>Client:</p>
  
  <pre><code>var io = require('socket.io-titanium');
  var socket = io.connect('http://myserver.com:3000');
  socket.on('connect', function (data){
    Ti.API.log("socket.io connected");
  });
  socket.on('update', function (data){
    Ti.API.log(data);
  });
  </code></pre>
  
  <p>Server:</p>
  
  <pre><code>index = fs.readFileSync(__dirname + '/index.html');
  var updates = http.createServer(function(req, res) {
    res.writeHead(200, {'Content-Type': 'text/html'});
    res.end(index);
  });
  
  var io = require('socket.io').listen(updates);
  
  var clients = {};
  
  io.sockets.on('connection', function(socket) {
      console.log("Server Connection Event");
      socket.on('i am client', console.log);
  });
  
  io.set("polling duration", 10);
  io.set("close timeout", 30);
  updates.listen(3000, function(){
   console.log("Updates listening on port 3000");
   console.log("");
  });
  </code></pre>
  
  <p>I received "Server Connection Event" once in the middle of a VERY long stream (100+)</p>
  
  <p>I believe the idea of the handshake is that the connection only needs to be authorized &amp; established once per user until the connection is closed.</p>
  
  <p>Any help will be greatly appreciated!</p>