I'm writing a an Android app that connect to a socket implement by Node.JS + socket.io. I'm using AndroidAsync (https://github.com/koush/AndroidAsync) for Android Client. I want to emit some events that only specified client can listen. But I can't find how to join in a room on Android client.
When client connects on server side, you have handle of socket and it has ID socket.id. This ID is unique per socket so you can use it to identify sockets.
So on connection you can make your own arrays of sockets and push them there. Then you can iterate through them and emit any message.
It is not necessary to use built-in rooms for this, and you can make yours easily.
So Identifying sockets your own way - will allow you to manage them better and will give you ability to send messages to specific socket. As far as there is a way to reference it using ID or any other identification method.
Yes, use SocketIOClient.of to join a specific endpoint/channel. See:
You get a similar connect callback that is invoked when the endpoint is connected, providing a new socketioclient for that specific endpoint.