-
-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detecting ICE connection that will never connect #253
Comments
Will address in next weeks. Too busy with many other things. Thanks. |
Hi @ibc , can I take this change up in a PR? About the As for option 2, we can discuss this further, but this can be a seperate change, as doing option 1 itself would let users implement such checks in their code. |
Fixes #253 - Add `transport.iceGatheringState` getter. - Add `transport.on('iceGatheringStateChangeEventNumTimesCalled', (iceGatheringState) => { })` event, - Bonus track: Reset `transport.connectionState` to "closed" within `transport.close()` method. *NOTE:* This is done in all handlers. It may happen that super old ones (`Chrome55`) don't support `icegatheringstatechange` event. I won't do magic. We'll remove those super old handlers soon anyway.
Fixes #253 - Add `transport.iceGatheringState` getter. - Add `transport.on('iceGatheringStateChangeEventNumTimesCalled', (iceGatheringState) => { })` event, - Bonus track: Reset `transport.connectionState` to "closed" within `transport.close()` method.
Feature Request
Problem
Under normal circumstances, in case of connection issues, the ICE connection should eventually fail.
connectionstatechange
event will fire, and the application will have the opportunity to do something with it.However, if all ICE candidates error during the gathering, the connection will forever stay in a
new
state andconnectionstatechange
event will never fire.Example:
It will be possible to produce and consume, but actually, no data will be transmitted since there's no live candidate pair.
The client can check periodically for candidate pairs in stats and timeout, but there is a better way by using
RTCPeerConnection.onicegatheringstatechange
event.If ICE
iceGatheringState
changes tocomplete
andconnectionState
is stillnew
- that means it's a dead end unlessrestartIce()
will be invoked. It's a good opportunity for the application to warn the user that something went wrong.However, right now,
mediasoup-client
doesn't expose theiceGatheringState
, noronicegatheringstatechange
handler.Proposal
Option 1: Expose the
onicegatheringstatechange
event andiceGatheringState
on theTransport
so that application can check for it.Option 2: Add a new
Transport
event which will fire onpc.iceGatheringState === 'complete' && pc.connectionState === 'new'
that will indicate a connection that can't be establishedCaveats
onicegatheringstatechange
has good browser support. If we want to cover even more browsers, we can rely onicecandidate
event andevent.candidate === null
, which also indicates that the gathering is finished.The text was updated successfully, but these errors were encountered: