How to show a connected user online using a ratchet mechanism?

Could you tell me how to show a connected user online using a ratchet mechanism? I want to say that I want to send some kind of server useridand pass this identifier to all other connected users, indicating that this one useridis on the network.

+4
source share
1 answer

You will need to identify these users and have their identifiers, and then write a simple class that will always listen to this WebSocket for any user changes (users are connected, disconnected).

- , .

, .. WebSocket WebSocket onMessage ( userId , ).

, , : http://socketo.me/docs/hello-world

+4

All Articles