webrtc icon indicating copy to clipboard operation
webrtc copied to clipboard

PeerConnection should support shutdown on DTLS Close

Open EmrysMyrddin opened this issue 3 years ago • 2 comments

Your environment.

  • Version: v2.2.26
  • Browser: firefox 88.0b8

What did you do?

I'm calling the PeerConnection.Close function.

What did you expect?

The connection should be closed, and I should see the connection on the remote peer being disconnected.

What happened?

The connection on the remote peer does not go to disconnected state instantly. It does after the SettingsEngine.tiemout.ICEConnection timeouts (which is 30 seconds by default).

I'm perhaps missing something here since I'm fairly new to the webrtc field.

EmrysMyrddin avatar Apr 16 '21 14:04 EmrysMyrddin

deer friends closepeer function not remote the peer message , you need remote message tell this peer let peer user close you connect to

vcluo avatar Apr 29 '21 06:04 vcluo

Hey @EmrysMyrddin thanks for checking out Pion :)

With WebRTC you can't depend on a graceful hangup. Everything is over UDP, and the other side can just stop sending/accepting packets.

I would depend on ICEConnectionState which will timeout. People also communicate quicker hangups via their signaling server.

WebRTC does have some facilities for faster hangup though. We don't support any of them today (but we should!) I will leave the ticket open and we can address in the future. I wouldn't depend on these though. WebRTC clients don't have to send them, and they only work if you have no packet loss and a graceful shutdown.

  • DTLS Close
  • SCTP Shutdown
  • RTCP Bye

Sean-Der avatar Apr 30 '21 04:04 Sean-Der

@Sean-Der Hi! I'm very interested in this issue as I've had multiple reports against aiortc wishing for faster detection of the remote peer disconnecting. Where do the specs say that a peer connection should be torn down when DTLS is closed?

jlaine avatar Jan 25 '24 16:01 jlaine