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

RTCDataChannel: transition to closing? #838

Open
aboba opened this issue Apr 28, 2018 · 1 comment
Open

RTCDataChannel: transition to closing? #838

aboba opened this issue Apr 28, 2018 · 1 comment

Comments

@aboba
Copy link
Contributor

aboba commented Apr 28, 2018

Lennart has raised the question as to how an application determines that a remote peer has called RTCDataChannel.close() in Issue w3c/webrtc-pc#1827 .

The specification appears to indicate that this causes a peer receiving an incoming stream reset to transition the RTCDataChannel readyState to closing, with no resulting event (e.g. onclose event handler is not fired). Adding an onclosing event handler seems icky.

Looking at RFC 6525 and Section 6.7 of draft-ietf-rtcweb-data-channel, one way to handle this would be to have receipt of an incoming stream reset cause readyState to transition to closed. The receipt of an incoming stream reset causes an outgoing stream reset to be sent. While after sending an outgoing stream reset the peer could transition readyState to closing and await receipt of a re-configuration response with a result of success prior to transitioning readyState to closed, after sending the outgoing stream reset, data can neither be sent nor received so closed might be more appropriate.

"6.7. Closing a Data Channel

Closing of a data channel MUST be signaled by resetting the
corresponding outgoing streams [RFC6525]. This means that if one
side decides to close the data channel, it resets the corresponding
outgoing stream. When the peer sees that an incoming stream was
reset, it also resets its corresponding outgoing stream. Once this
is completed, the data channel is closed. Resetting a stream sets
the Stream Sequence Numbers (SSNs) of the stream back to 'zero' with
a corresponding notification to the application layer that the reset
has been performed. Streams are available for reuse after a reset
has been performed.

[RFC6525] also guarantees that all the messages are delivered (or
abandoned) before the stream is reset."

@aboba
Copy link
Contributor Author

aboba commented Jun 1, 2018

Related WebRTC 1.0 PR (merged): w3c/webrtc-pc#1822

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

No branches or pull requests

1 participant