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

Update examples #1856

Merged
merged 1 commit into from
Jul 2, 2021
Merged

Update examples #1856

merged 1 commit into from
Jul 2, 2021

Conversation

Antonito
Copy link
Member

This PR updates examples/:

  • to defer a peerConnection.Close call
  • if relevant, cancel the execution on an ICE Disconnected event
  • Use MimeType constants

This should hopefully fix #839.

Also updates TestNonFatalRead with a timeout, as it failed after 11 minutes on my previous PR (there seems to be some kind of deadlock, which I didn't investigate further).

@codecov
Copy link

codecov bot commented Jun 28, 2021

Codecov Report

Merging #1856 (af62aa8) into master (8a0df90) will decrease coverage by 0.07%.
The diff coverage is n/a.

❗ Current head af62aa8 differs from pull request most recent head 4d3ab28. Consider uploading reports for the commit 4d3ab28 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1856      +/-   ##
==========================================
- Coverage   75.65%   75.58%   -0.08%     
==========================================
  Files          84       84              
  Lines        6046     6049       +3     
==========================================
- Hits         4574     4572       -2     
- Misses       1085     1088       +3     
- Partials      387      389       +2     
Flag Coverage Δ
go 77.27% <ø> (-0.08%) ⬇️
wasm 71.26% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
dtlstransport.go 63.88% <0.00%> (-1.86%) ⬇️
settingengine.go 60.60% <0.00%> (+0.60%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a0df90...4d3ab28. Read the comment docs.

@Sean-Der
Copy link
Member

🔥 this is fantastic @Antonito! Thank you for grabbing all these long standing issues

@Sean-Der
Copy link
Member

Sean-Der commented Jul 1, 2021

@Antonito Sorry for the long wait time on the review!

Can you print the error if peerConnection.Close() fails, want to encourage good logging :)

Can you do OnPeerConnectionState and look for PeerConnectionStateFailed. That way users catch DTLS errors as well. The PeerConnection can come back from disconnected. If you want to add a comment around 'Use disconnected if you are interested in detecting faster timeout' I am in support!

Call out what causes failure, and mention ICE restart. Wait until PeerConnection has had no network activity for 30 seconds or another failure. It may be reconnected using an ICE Restart.

@Antonito
Copy link
Member Author

Antonito commented Jul 2, 2021

@Sean-Der No worries, I've been busy too!

I originally wanted to work with PeerConnectionStateFailed, but wrongly decided to follow blindly what was on the issue #839 – this should look better now! :)

@Sean-Der Sean-Der force-pushed the fix/issue-839 branch 4 times, most recently from 73fdc2f to 45e56d1 Compare July 2, 2021 15:33
TestNonFatalRead now has an timeout.
Examples now use Mime types, instead of raw strings.

Fixes #839
@Sean-Der Sean-Der merged commit 7e049ec into master Jul 2, 2021
@Sean-Der Sean-Der deleted the fix/issue-839 branch July 2, 2021 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Update samples to use RTCPeerConnectionState and show graceful teardown
2 participants