Reconnection best practice


I was using OV for a quite a bit now in production environment and I always have one problem. I’m a native iOS/Android apps developer and I’m using RPC protocol. I also following the practice described Signaling Plane Breaks, but this just doesn’t work for my case. I believe I can’t be alone. Or may be I just missed something.

So, recommended method in case of Internet disruption is to call “connect” RPC call as soon as the socket connection restored. The “connect” may tell you either that everything is fine, or you need to reconnect as a new user to the session (if you get evicted). In fact you always need to reconnect as a new user, and the call to “connect” just useless.

When you was offline you obviously couldn’t be notified about any changes like someone leaves or join the session. And as far as I see, there’s no RPC call which gives you updated information about currently connected participants and their connection/stream IDs. As result, if you follow the practice described in Signaling Plane Breaks, you won’t be able to reconnect new users. You just don’t know of their existence and you don’t know their connection IDs so you can’t call onIceCandidate because it requires endpoint parameter which is in fact a connection ID of a remote player.

If the call to retried the same information as joinRoom does would exists (in particular to retrieve the streams array) it solves the problem. But I can’t find one (I use CE, but I can’t see it in PRO or Enterprise either).

You may think at this moment that this is quite unlikely that anyone may join the session exactly at the time when you briefly (< 1min, because after 1 min you get evicted) went offline. But in fact this is not unlikely, it is in fact very common. Let me give you an example.

Let’s imagine for a moment that we have some brief outage either because my server rebooted, get overloaded or stuck or because of a brief network failure on the side of my server datacenter. The videoconference participants will see that the app is frozen and let’s say half of them will restart the app hoping that this will resolve the issue. In 15 seconds the connection get back to normal, and the participants who didn’t restart the app and patiently wait for the connection can’t now see the good half of the users. Ones who restarted the app joined as a new users, get the new connection ID and stream ID which are unknown to the other participants because they missed participantJoined event. (side note: I just checked participantJoined documention and don’t see streams array in returned data. But it actually there, just for some reason the docs doesn’t reflect it).

Please let me know if I missed something.

Thank you,
Mike Keskinov