title: get room of a socket in socket.io
body: <p>How do I retrieve the rooms a socket is a member of?
  I'm using socket.io version 1.4</p>
  
  <p>I tried with <code>this.socket.adapter.rooms</code> but I received this error in the chrome console: <code>Cannot read property 'rooms' of undefined</code>  </p>
  
  <p>In my client code I have this method:</p>
  
  <pre><code>send(msg) {
          if(msg != ''){
              var clientInfo = [];
              clientInfo.push(msg);
              clientInfo.push(socket.id);
              clientInfo.push(this.socket.adapter.rooms);
              socket.emit('message', clientInfo);
          }
      }
  </code></pre>
  
  <p>On my server side:</p>
  
  <pre><code>socket.on('message', function(clientInfo){
          var clientmessage = clientInfo[0];
          var clientid = clientInfo[1];
          var clientroom = clientInfo[2];
          io.to(clientroom).emit('messageSent', clientmessage);
      });
  </code></pre>