prevent channel from opening if connection is closed

This commit is contained in:
schlagmichdoch 2023-01-23 05:28:08 +01:00
parent 9c6637b3f5
commit 19d7e6fecd

View file

@ -518,6 +518,7 @@ class RTCPeer extends Peer {
}
_openChannel() {
if (this._conn.signalingState === "closed") return;
const channel = this._conn.createDataChannel('data-channel', {
ordered: true,
reliable: true // Obsolete. See https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/reliable