Port from Astagor v3

This commit is contained in:
Piotr Pawałowski 2025-09-25 09:34:15 +02:00
parent dc6f5f80c6
commit 83ee0498b6

View file

@ -69,6 +69,9 @@ class Peer extends EventEmitter
this._closed = true;
if (this.socket)
this.socket.disconnect(true);
// Iterate and close all mediasoup Transport associated to this Peer, so all
// its Producers and Consumers will also be closed.
for (const transport of this.transports.values())
@ -76,9 +79,6 @@ class Peer extends EventEmitter
transport.close();
}
if (this.socket)
this.socket.disconnect(true);
this.emit('close');
}