title: Socket.IO Connected User Count
body: <p>I finally got <code>Socket.IO</code> to work properly, but I have encountered a strange problem.</p>
  <p>I am not sure if this is the best way, but I am using:</p>
  <pre><code>io.sockets.clients().length
  </code></pre>
  <p>This returns the number of clients connected to my server. The problem is after a few connects and disconnects of users, the number starts to stay higher than it should be.</p>
  <p>For instance, if I connect and ask my friends to, the number goes up which is correct. But when we start to disconnect and reconnect the number does not decrease.</p>
  <p>I am running the <code>Node.js</code> and <code>Socket.IO</code> server on a <a href="https://en.wikipedia.org/wiki/VMware" rel="noreferrer">VMware</a> <a href="https://en.wikipedia.org/wiki/Ubuntu_%28operating_system%29" rel="noreferrer">Ubuntu</a> server.</p>
  <p>Why is this or is there a better method for finding out how many people are connected to the server?</p>