Menu
  • HOME
  • TAGS

Creating/Managing private rooms using Ratchet?

php,websocket,ratchet,phpwebsocket

Will different instance of socket event loop needed to run for separate rooms ? No. Only one loop is needed. Your snippet is fine. What you have to do is to adjust Chat class so that it accepts additional parameter from the user input - room id/name. For example,...

Show message to a group of users instead of all users using Websocket in php

php,websocket,phpwebsocket

From the code provided, it appears that your $clients array holds only the socket handle for that specific connection. Find the line in your server that has the function socket_accept(). It will probably look like: $clients[] = socket_accept($socket); My personal choice for a quick and dirty fix would be to...