- From: jan-ivar via GitHub <sysbot+gh@w3.org>
- Date: Thu, 15 Mar 2018 13:55:15 +0000
- To: public-webrtc-logs@w3.org
> Because certainly onclose fires when closing a data channel. @lgrahl That seems true of `channel.close()`, on both ends to boot (the benefit of a data channel). But not [pc.close](https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-close) whose sole mention of data channels (unless I'm missing something) is: *"Set the [[ReadyState]] slot of each of connection's RTCDataChannels to "closed"."* However, both Chrome and Firefox appear to fire `close` on both ends of a data channel on `pc.close()`, when I run [this fiddle](https://jsfiddle.net/jib1/5as2wp2w/) (type `"pcclose"` in the chat). There's a difference though: a data channel can be closed remotely, whereas a peer connection cannot. The workaround for this in practice is to open a data channel: `channel.onclose = e => pc.close()`. So I think we should at least fix the `pc.close` steps here to align with implementations, as this works and seems useful. -- GitHub Notification of comment by jan-ivar Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/1799#issuecomment-373383526 using your GitHub account
Received on Thursday, 15 March 2018 13:55:17 UTC