0

I'm new to socket.io 1.1. From what I understand, upon connection loss/disconnection, the server-side socket automatically leaves all rooms and disconnect is fired. By the time disconnect is fired, socket.rooms is already cleared.

I would like to announce to the previously joined rooms that the current user had left. Are those previously connected room ids stored somewhere? Alternatively, is there some sort of onLeaveRoom or beforeDisconnect mechanism built into socket.io where the room ids can be intercepted?

Thanks for your help!

lastoneisbearfood
  • 3,955
  • 5
  • 26
  • 25
  • possible duplicate of [Get the list of rooms the client is currently in on disconnect event](http://stackoverflow.com/questions/25830415/get-the-list-of-rooms-the-client-is-currently-in-on-disconnect-event) – DerM Sep 29 '14 at 08:04
  • Probably store them in variables in your Node.JS code?.. – Placeholder Sep 29 '14 at 14:52
  • @DerM, That is exactly what I'm looking for. Thanks for spotting the duplicate. And thanks for answering that other question as well! – lastoneisbearfood Oct 04 '14 at 11:24

0 Answers0