express.io icon indicating copy to clipboard operation
express.io copied to clipboard

How to find out what room I'm in.

Open murvinlai opened this issue 10 years ago • 1 comments

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.

murvinlai avatar Jul 16 '14 00:07 murvinlai

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?

narthur157 avatar Aug 06 '14 21:08 narthur157