title: socket.io 'connect' or 'reconnect' event not fired after reconnect
body: <p>i have a problem with using Socket.io.</p>
  
  <p>code is simple:</p>
  
  <pre><code>var socket = null;
  var socketInit = false;    //if it is true, use reconnect
  
  ...
  function connect() {
      if(!socketInit) {
          socket = io();
          socketInit = true;
  
          //attach event handlers
          socket.on('connect', function() {
              console.log('connect fired!');
          });
          socket.on('disconnect', function() {
              console.log('disconnect fired!');
          });
          socket.on('reconnect', function() {
              console.log('reconnect fired!');
          });
      }
      else {
          socket.io.connect();
      }
  }
  
  ...
  function disconnect() {
      socket.disconnect();
  }
  </code></pre>
  
  <p>as you can see, there are two functions that connect or disconnect socket. and in connect function, it attachs 'connect', 'disconnect', 'reconnect' handlers to the socket.</p>
  
  <p>first i called connect function, it works well. server side is also working well. and i called disconnect function, works well too so as the server.</p>
  
  <p>but i called connect function again, that means "socketInit" variable is true, so connect function tries:</p>
  
  <pre><code>socket.io.connect();
  </code></pre>
  
  <p>i checked the server and client console both, and looks like it has connected, but the problem is the events are not fired!</p>
  
  <p>server side 'connection' event was fired on reconnection but client side 'connect' or 'reconnect' event wasn't fired. i tried to figure out what is going on, but still i don't get it. i checked web console and server console many times, and the connection itself is working fine, but the problem is events are not working!</p>
  
  <p>if someone know the way, it will be very appreciated to help me. thanks ;)</p>
  
  <p>p.s. i tried to add 'reconnected', 'reconnection', 'reconnect_error' event handlers, but neither not works.</p>