title: getting how many people are in a chat room in socket.io
body: <p>I have this code right now that sets the nick and room:</p>
  
  <pre><code>io.sockets.on('connection', function(client){
      var Room = "";
      client.on("setNickAndRoom", function(nick, fn){
          client.join(nick.room);
          Room = nick.room;
          client.broadcast.to(Room).emit('count', "Connected:" + " " + count);
          fn({msg :"Connected:" + " " + count});
      });
  </code></pre>
  
  <p>I wanted to know how I could get how many people are connected to a specific chatroom...like Room.length</p>
  
  <p>client side : </p>
  
  <pre><code>function Chat(){
      this.socket = null;
      this.Nickname = "";
      this.Room = "";
      var synched = $('#syncUp');
      this.Connect = function(nick, room){ 
          socket =  io.connect('http://vybeing.com:8080');    
          Nickname = nick;
          Room = room;
          //conectarse
          socket.on('connect',function (data) {
              socket.emit('setNickAndRoom', {nick: nick, room: room}, function(response){
                  $("#connection").html("&lt;p&gt;" + response.msg + "&lt;/p&gt;");
              });
          });
  }
  </code></pre>
  
  <p>I found this, but it gives undefined:</p>
  
  <pre><code>count = io.rooms[Room].length;
  </code></pre>