implement a flush capability for data channels#63
Open
cuchaz wants to merge 2 commits intowebrtc-rs:masterfrom
Open
implement a flush capability for data channels#63cuchaz wants to merge 2 commits intowebrtc-rs:masterfrom
cuchaz wants to merge 2 commits intowebrtc-rs:masterfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #63 +/- ##
==========================================
- Coverage 71.17% 71.11% -0.07%
==========================================
Files 442 442
Lines 67330 67452 +122
==========================================
+ Hits 47922 47966 +44
- Misses 19408 19486 +78 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello again,
In my application, it is useful to know when a data channel message has "finished" sending (but not necessarily received by the remote peer), so I've implemented a flush-like capability. It works by inserting a special flush meta-message into the processing pipeline (including the SCTP stream) which can be polled later using a specialized function. If I've implemented this correctly, the flush message should not be pollable until all the socket datagrams corresponding to all previous data channel message are also pollable.
This may not be the simplest way to implement a feature like this, but it's the first way I've found so far that works. It modifies a lot of different layers of the processing pipeline, so I realize it may not be such a welcome change.
Would you be interested in adding a flush feature to data channels? The attached PR is a draft implementation to illustrate the idea, but I don't know if it's really the best way to do this. Maybe you know of a better way? Or maybe this is a good enough starting point and we work on it from here.
Thanks,
Jeff