-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat(webrtc): implement fin ack #5687
base: master
Are you sure you want to change the base?
Conversation
Thank you for your contribution @tesol2y090 and sorry for the delay here! Will try to give this a review in the next days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay here @tesol2y090.
Some first comments.
misc/webrtc-utils/src/stream.rs
Outdated
.expect("to not close twice") | ||
.send(GracefullyClosed {}); | ||
// Check if we've received FIN_ACK or deadline has passed | ||
if self.state.fin_ack_received() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this, but don't we need to somehow continue reading here to be able to receive the FIN_ACK
?
With AsyncWriteExt
for instance a future will be created that only returns after poll_close
succeeded i.e. no concurrent call to poll_read
happens. With the current impl, I don't think a FIN_ACK
will ever be read in that case?
On the other hand, we'd then have to discard the read messages or buffer them. Not sure how this is handled e.g. in QUIC, or in the go implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I looked into the QUIC and TCP transports to check how they handle this in their poll_close
function.
However, as far as I can tell neither of them wait in poll_close
for the sent FIN
to be acknowledged in the first place.
Unfortunately I couldn't find any prior discussion about this.
This pull request has merge conflicts. Could you please resolve them @tesol2y090? 🙏 |
Regarding whether If the read side is closed anyway, we can just read from within If the read side isn't closed yet we have two options:
I think we should go with nr. 2, but I wonder if there are any better options that I didn't think of (cc @dariusc93 @jxs). |
Description
Implements FIN_ACK support for WebRTC streams to ensure reliable closure handshaking as specified in the WebRTC spec. This adds:
FIN_ACK
#4600Notes & open questions
Instant
for deadline tracking instead of tokio timer to avoid extra dependenciesChange checklist