Server side 'roomLeave' doesn't fire anytime

37 views
Skip to first unread message

Angel Todorov

unread,
Jul 1, 2015, 5:37:23 AM7/1/15
to eas...@googlegroups.com
Hi there,
I have some issue with server side event "roomLeave" and I hope you can help me solve it.

Here is the use case:
I am processing on the server side "roomJoin" & "roomLeave" events and manage room participants as room field array, meaning:
- on 'roomJoin' each new room occupants has been added to the room array
- on 'roomLeave' each leaving room occupants has been removed from the room array. When all room participants left the room, it is deleted.
then on the client side via roomListener it is quite easy for me to manage connection relations based on their presence into the room. So far, so good.

It appears however, that sometimes when the connection is not properly closed (for instance, instead of leaving the room, the user just close the web browser), 'roomLeave' event is not fired for particular user and the connection stayed into the room, but it is no longer valid (easyrtcId is not valid). The connection however prevents deleting the room, which breaks some application internal logic. For instance since I have reserved room names (stored persistently), when room owner re-enters the room it is not expected to find invalid connections / occupants inside the room...

So what I actually need is some kind of "garbage collector" for already invalid room occupants...
any ideas how to create re-use some will be greatly appreciated.

Regards,
Angel

Angel Todorov

unread,
Jul 26, 2015, 6:44:56 AM7/26/15
to EasyRTC, angel.a...@gmail.com
Any ideas, thoughts, suggestions...
I think it is quite basic issue and a hint how to handle it could be very useful...

Best Regards,
Angel

Eric Davies

unread,
Jul 26, 2015, 12:49:54 PM7/26/15
to EasyRTC, angel.a...@gmail.com
We've noticed this ourselves. It's very annoying. Rod thinks it's a problem in socket.io.

In theory, socket.io should be noticing the lack of keep alives messages from the client and get rid of the client. In practice, my (uneducated) guess is that it tries to close the socket first, fails for some reason, and doesn't continue with the rest of the cleanup. 

You might try switching to socket.io version 1.* instead of 0.9 and see if that makes the problem go away. Last I checked, our code will run with version 1.* without any additional problems.

If you can come up with way of consistently causing the problem, that would go a long way in helping us isolate the problem. 
Reply all
Reply to author
Forward
0 new messages