express.io
express.io copied to clipboard
How to find out what room I'm in.
Let say, in one socket request from Client A, the server does that: req.io.join("AAA"); and emit the message to all people in the room.
and then in next request , in client side, Client A sends message back to server like that: io.emit('stageA', "AAA");
Then from the server side, is the request coming to here:
app.io.route('stageA', function(req) {
...});
automatically in the room? do I need to req.io.join again before emit another message?
also, how do I find out what room it is.
My understanding is that rooms are for broadcasting to a limited set of clients. You can broadcast to a room whenever you want to. It doesn't actually matter if that client is in the room or not.
Your question is unclear, what are you trying to do?