When WebRTCPeer disconnects/closes connection it is never propagated to the server

Viewed 33

I am using an implementation of https://github.com/webrtc for my app. I have a networking stack implemented that uses WebRTC. The issue I am seeing is that when the client exits the app it closes the PeerConnection object, and the server gets a state change from kIceConnectionConnected to kIceConnectionDisconnected which is good and all but I would expect to see kIceConnectionClosed. The problem with the disconnected state is that if your network is spotty then you can intermittently get kIceConnectionDisconnected state which may heal itself afterward. And I don't want to close the connection.

The question is: how do I as a server guarantee that the client has quit the app and that I can tier down the connection on the server side right away?

Edit: According to https://datatracker.ietf.org/doc/html/draft-ietf-rtcweb-data-channel-13#section-6.7 there should be a channel reset that happens on both sides, how would server knows that it needs to reset the channel?

0 Answers
Related