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

webrtc: close data channels cleanly #2724

Closed
wants to merge 2 commits into from
Closed

webrtc: close data channels cleanly #2724

wants to merge 2 commits into from

Commits on Mar 6, 2024

  1. webrtc: close data channels cleanly

    WebRTC data channel close is a synchronous close procedure. We close our
    outgoing stream, in response the peer is expected to close its outgoing
    stream. If the peer doesn't close its side of the stream we will end up
    with a memory leak where the SCTP transport keeps reference to the
    stream. So we check the number of invalid data channel closures and when
    this goes over a threshold we close the connection.
    
    For our custom purposes we can fork SCTP and implement a unilateral
    stream Reset which is feasible because we anyway have a state machine
    on top of the data channels. But for a RFC compliant SCTP
    implementation, this is how the spec is supposed to work. SCTP stream
    numbers are limited (uint16) so we do need to reuse the stream ids
    forcing us to use a synchronous close mechanism.
    sukunrt committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    3832d79 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4fb66c5 View commit details
    Browse the repository at this point in the history