title: Move another user to a room with Socket.io
body: <p>I am using Socket.io with Node.js and I would like to pair users up and send them to a new room.</p>
  
  <p>When a user connects, within <code>io.on('connection')</code> I determine their compatibility with a user waiting to be paired in an array.</p>
  
  <p>If the user who has joined is compatible with a waiting user, I want to move them both to a new room.</p>
  
  <p>This is my current approach. Note: <code>[1029387,1983934,9243802]</code> is an array of user IDs.</p>
  
  <pre><code>var pendingPlayers = {
      "spelling": {
          "level1":[1029387,1983934,9243802],
          "level2":[]
       }
  }
  
  
  io.on('connection', function(socket) {
      // check compatibility
      // move current player and other queued player to new room
  });
  </code></pre>
  
  <p>The only idea I have is to <code>socket.emit('room', 'new room name');</code> from server to client, for the queued player to send this ID back to the server and then use:</p>
  
  <pre><code>io.on('connection', function(socket) {
      socket.on('room', function(room) {
          socket.join(room);
      });
  });
  </code></pre>
  
  <p>However, sending the room name to the client, to then send it back to the server seems awfully far-fetched. I'm hoping there's an easier way.</p>
  
  <p>Your suggestions are gratefully received.</p>