title: Ratchet : How to use both chat and push notifications on the same server
body: <p>i would like to use on the same server both applications "chat" and 'push notifications" comming from the tutorial of ratchet (<a href="http://socketo.me" rel="nofollow">http://socketo.me</a>) 
  - "Hello world" (<a href="http://socketo.me/docs/hello-world" rel="nofollow">http://socketo.me/docs/hello-world</a>)
  - "push integration" with ZMQ .<br>
  each application works well , i run chat-server.php (for chat) and push-server.php (for push integration) . But when i open two cmd window and run both it does not working . It is maybe a stupid question , but i'm a beginner in this field .</p>
  
  <p>find below the code of both executable</p>
  
  <hr>
  
  <p>chat-server.php :</p>
  
  <p>use Ratchet\Server\IoServer;
  use MyApp\Chat;</p>
  
  <pre><code>require dirname(__DIR__) . '/vendor/autoload.php';
  
  $server = IoServer::factory(
      new Chat(),
      8080
  );
  
  $server-&gt;run();
  </code></pre>
  
  <hr>
  
  <p>push-server.php :</p>
  
  <pre><code>require dirname(__DIR__) . '/vendor/autoload.php';
  
  $loop   = React\EventLoop\Factory::create();
  $pusher = new MyApp\Pusher;
  
  // Listen for the web server to make a ZeroMQ push after an ajax request
  $context = new React\ZMQ\Context($loop);
  $pull = $context-&gt;getSocket(ZMQ::SOCKET_PULL);
  $pull-&gt;bind('tcp://127.0.0.1:5555'); // Binding to 127.0.0.1 means the only client that can connect is itself
  $pull-&gt;on('message', array($pusher, 'onBlogEntry'));
  
  // Set up our WebSocket server for clients wanting real-time updates
  $webSock = new React\Socket\Server($loop);
  $webSock-&gt;listen(8080, '0.0.0.0'); // Binding to 0.0.0.0 means remotes can connect
  $webServer = new Ratchet\Server\IoServer(
      new Ratchet\Http\HttpServer(
          new Ratchet\WebSocket\WsServer(
              new Ratchet\Wamp\WampServer(
                  $pusher
              )
          )
      ),
      $webSock
  );
  
  $loop-&gt;run();
  </code></pre>
  
  <hr>
  
  <p>Thanks in advance for your help . let me know If you need more informations  </p>