Skip to content
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

Restart ICE only on failed connection states #3899

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

andresuribe87
Copy link
Contributor

According to https://www.w3.org/TR/webrtc/#dictionary-rtcofferoptions-members ,

Note
Performing an ICE restart is recommended when iceConnectionState transitions to "failed". An application may additionally choose to listen for the iceConnectionState transition to "disconnected" and then use other sources of information (such as using getStats to measure if the number of bytes sent or received over the next couple of seconds increases) to determine whether an ICE restart is advisable.

This PR changes the default webrtc implementation to follow such guidance. We've seen instances where choppy networks trigger a lot of renegotiations that aren't necessary.

@aler9
Copy link
Member

aler9 commented Oct 31, 2024

Hello @andresuribe87, i checked the client-side implementation of WebRTC (that is supposedly following the specification) and also the server-side implementation (that was my main doubt) and i can confirm that WebRTC connections can be automatically recovered when iceConnectionState is disconnected, while they must be recreated when iceConnectionState is failed, as you mentioned.

With respect to this PR, the check on iceConnectionState has to be changed on both client and server, furthermore i recently moved the client-side implementation into a separate file - so i'm adapting it in order to account for these changes.

@aler9 aler9 merged commit f8b366c into bluenviron:main Oct 31, 2024
6 checks passed
@aler9
Copy link
Member

aler9 commented Oct 31, 2024

merged, thanks for providing the hint!

Copy link
Contributor

github-actions bot commented Dec 3, 2024

This issue is mentioned in release v1.10.0 🚀
Check out the entire changelog by clicking here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants