title: Socket.io connection piles up on each refresh
body: <p>I'm using socket.io with node.js and inside one of my routes, I have the connection event handler.</p>
  
  <pre><code>            app.io.on('connection', function(socket) {
                      console.log('connect');
  
                      socket.on('disconnect', function(){
                          console.log('disconnect');
                          res.end();
                      });
              });
  </code></pre>
  
  <p>Each time I refresh the page that's calling this route, it seems to keep adding up, for example, if I refresh 5 times, I'll end up having 5 'connect' messages, on a single refresh, in the log.</p>
  
  <p>Is there a good way to limit this so it doesn't do this?</p>
  
  <p>Thanks!</p>
  
  <p>Edit:</p>
  
  <p>When I refresh repeatedly, I get this error:</p>
  
  <blockquote>
    <p>(node) warning: possible EventEmitter memory leak detected. 11
    listeners added. Use emitter.setMaxListeners() to increase limit</p>
  </blockquote>
  
  <p>I can increase the limit, but I have a feeling that's no the correct solution.</p>