提交 19d40e26 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

RTCPeerConnection: be ready for transport closure

上级 a4561acb
......@@ -162,6 +162,20 @@ class RTCPeerConnectionCommon extends EventEmitter
})
.then((transport) =>
{
// If the transport is abruptly closed (for example, a DTLS Close Alert is received)
// close the peer.
// TODO: This may not work fine with Firefox:
// https://bugzilla.mozilla.org/show_bug.cgi?id=1355486
transport.on('close', () =>
{
if (this.closed)
return;
this._logger.warn('transport closed, closing peer');
this.close();
});
// If maxBitrate was given, set it.
if (this._options.maxBitrate)
return transport.setMaxBitrate(this._options.maxBitrate);
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论