I'm trying to understand how are we supposed to manage client in Swoole Websocket Server.
I've MyServer who extends from Swoole\WebSocket\Server, I store in a property the client list, but it seems every single client can only see his own list (with only him in it). So if the client 1 send a message who have to be resent to the client 2, the only I've found is to use the getClientList method and send the message to all clients.
But I want also to "bind" clients between themselves ... Like 1 with 2 only, 3 with 4 a,nd 5 etc.
I use APCu (forced to CLI mode) to communicate client list to all my client, but it seems I've some multi acces problems now.
Isnt a "native" way in Swoole Websocket Server to store information on my client, information who could by read from any client?
After some more research, I found that Swoole provide a nice build-in class to manage session interaction : Swoole/Table
It's a fast "SQL like" memory management system that allow you to easily communicate between sessions, specifically usefull for websockets session!