title: Number of clients in the room in socket io v1
body: <p>I just started to play with socket.io and try to make something super simple like people connecting to the room. </p>
  
  <p>I expected this to give me the number of clients in the room</p>
  
  <pre><code>io.sockets.on('connection', function (socket){
      socket.on('create or join', function (channel) {
          var numClients = io.sockets.clients(channel).length;
          ...
     }
  })
  </code></pre>
  
  <p>But it returns an error: <code>Object #&lt;Namespace&gt; has no method 'clients'</code> because something has changed in V.1. After some searches I substituted the callback with another one:</p>
  
  <pre><code>    var clients = io.sockets.adapter.rooms[channel];
      var numClients = 0;
      if (typeof clients !== 'undefined'){
          numClients = clients.length;
      }
  
      p(numClients);   // p is just a wrapper on console.log()
      p(clients);
      socket.join(channel);
      socket.emit('created', channel);
  </code></pre>
  
  <p>But no matter how many times I connect, I get 0 as number of clients:</p>
  
  <pre><code>0
  undefined
  0
  [ hSxLuOqrm5bX4UxmAAAA: true ]
  0
  [ hSxLuOqrm5bX4UxmAAAA: true, '2bjYS0lrUFySPM1OAAAB': true ]
  </code></pre>
  
  <p>What do I do wrong?</p>
  
  <p><strong>P.S.</strong> here is how to get number of clients in the room:</p>
  
  <p><code>var numClients = (typeof clients !== 'undefined') ? Object.keys(clients).length : 0;</code></p>