title: Creating/Managing private rooms using Ratchet?
body: <p>I am making iOS chat application. After doing study on needed technology and protocols, I decided to give a websockets try. For reasons our stack top is php based and I came to know about ratchet as websockets for PHP. I made simple chat server for ios front-end from reading <a href="http://socketo.me/docs/hello-world" rel="nofollow noreferrer">documentation</a>. Chat is working very fine and I am comfortable with it too. I wanted to know on how to create separate private chat rooms. <strong>Will different instance of socket event loop needed to run for separate rooms ?</strong></p>
  <p>The sample server I made is using single event loop for managing user connections and dispatching messages to different connection/user id's. I really tried to look out for creating private chat rooms but haven't found any information where I could be confident.</p>
  <p>Will I have to manage each connection/user id's virtually on this event loop, like deciding which users can chat to each other directly by controlling the dispatching of messages ? Or is their really a separate way to do this ? This is the event loop sample as per documentation that I implemented:</p>
  <pre><code>   &lt;?php
     use Ratchet\Server\IoServer;
     use Ratchet\Http\HttpServer;
     use Ratchet\WebSocket\WsServer;
     use MyApp\Chat;
     
         require dirname(__DIR__) . '/vendor/autoload.php';
     
         $server = IoServer::factory(
             new HttpServer(
                 new WsServer(
                     new Chat()
                 )
             ),
             8080
         );
     
         $server-&gt;run();
  </code></pre>
  <p>I want to tell that I am a iOS/Android developer and really no expert or have fluent knowledge on web frontend/backend technologies.</p>