Skip to content

Clarification needed on Rooms #535

Answered by Totodore
FaeyUmbrea asked this question in Q&A
Discussion options

You must be logged in to vote

Hi! I recommend you to read this:
https://socket.io/docs/v4/rooms/.
This may help you to better understand rooms.
To answer your three questions:

  • When you broadcast a message to an inexistant room, it is dropped as there is no socket to send the message to.
  • Rooms are automatically cleaned each time a socket disconnects.
  • For your last point you need to manually implement something yourself maybe by checking if the socket exists with get_socket and emitting from it or storing it in a map of pending messages to send on the socket connection.

Don't hesitate if you need other clarifications.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Totodore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants