Problem: Persistent Room Occupants who never seems to get disconnected !

80 views
Skip to first unread message

Ataul Mukit

unread,
Jan 6, 2015, 6:50:15 AM1/6/15
to eas...@googlegroups.com
Hi,

Sometimes in the room occupant listener, function roomOccupantListener:function(roomName, occupants, isPrimary) ,
in the occupants list, some entries comes who are no longer connected to the server.

Even after 2 to 3 days, these entries are not cleared up.

My function body is simple:

                     for (var oldPeer in  peers) {

if (!occupants[oldPeer]) {
removeIfPresent(oldPeer);
delete peers[oldPeer];
}
}
for (var easyrtcid in occupants) {

if (!peers[easyrtcid]) {
addNewUser(easyrtcid, info);
peers[easyrtcid] = true;
}

The problem seems to be, the occupants variable, even though I may join a room after 2 or 3 days, somehow has some entries who have long disconnected from the server (maybe through a browser crash, or maybe browser close).

I would be very much obliged if anybody can tell me what can be the reason behind the easyrtc nodejs server (which uses a websocket server), does not eliminate these invalid entries some of the time.

*In my case, specially in testing phase, it may occasionally happen that just after sending a message, the user closes browser window (or his browser may crash)

Thanks in advance,

Ataul Mukit
Rational Technologies Ltd.
Dhaka, Bangladesh

Tingshen Chen

unread,
Apr 15, 2015, 1:57:34 PM4/15/15
to eas...@googlegroups.com
I have the same issue too with my persistent room, does anybody have a solution to this?

Rod Apeldoorn

unread,
Apr 16, 2015, 2:02:44 AM4/16/15
to eas...@googlegroups.com
I've seen it too. My guess is that there are circumstances where socket.io doesn't fire the disconnect event.

One solution would be to implement your own health check. Rotate through all the "active" connections which have been on for more than a given time (30mins?), send each a ping and if they don't answer (or if there is a socket error), disconnect them manually.

- Rod


Ataul Mukit

unread,
Apr 17, 2015, 12:52:13 AM4/17/15
to eas...@googlegroups.com
After upgrading to the latest socket.io and easyrtc beta branch, this problem is not happening for the time being.
But It will need further testing.
Reply all
Reply to author
Forward
0 new messages