Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
8be35aee
提交
8be35aee
authored
8月 30, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve transport closure
上级
49089984
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
20 行增加
和
8 行删除
+20
-8
Peer.js
lib/Peer.js
+4
-5
Room.js
lib/Room.js
+2
-0
Transport.cpp
worker/src/RTC/Transport.cpp
+14
-3
没有找到文件。
lib/Peer.js
浏览文件 @
8be35aee
...
@@ -636,14 +636,13 @@ class Peer extends EnhancedEventEmitter
...
@@ -636,14 +636,13 @@ class Peer extends EnhancedEventEmitter
this
.
_sendNotification
(
method
,
data2
);
this
.
_sendNotification
(
method
,
data2
);
});
});
// TODO: Do we need this? The C++ Transport closes all its Producers and
// On closure, the worker Transport closes all its Producers and Consumers,
// Consumers, and the client side gets producer.on('unhandled'), there is
// and the client side gets producer.on('unhandled'), so there is no need
// no need to close/destroy its local Producer.
// to close/destroy its local Producer.
// On Transport closure close the Producer.
transport
.
on
(
'@close'
,
()
=>
transport
.
on
(
'@close'
,
()
=>
{
{
if
(
!
producer
.
closed
)
if
(
!
producer
.
closed
)
producer
.
close
();
producer
.
close
(
undefined
,
false
);
});
});
this
.
emit
(
'@newproducer'
,
producer
);
this
.
emit
(
'@newproducer'
,
producer
);
...
...
lib/Room.js
浏览文件 @
8be35aee
...
@@ -119,6 +119,8 @@ class Room extends EnhancedEventEmitter
...
@@ -119,6 +119,8 @@ class Room extends EnhancedEventEmitter
if
(
this
.
_closed
)
if
(
this
.
_closed
)
return
Promise
.
reject
(
new
errors
.
InvalidStateError
(
'Room closed'
));
return
Promise
.
reject
(
new
errors
.
InvalidStateError
(
'Room closed'
));
// TODO: Should we aggregate Peers info?
return
this
.
_channel
.
request
(
'router.dump'
,
this
.
_internal
)
return
this
.
_channel
.
request
(
'router.dump'
,
this
.
_internal
)
.
then
((
data
)
=>
.
then
((
data
)
=>
{
{
...
...
worker/src/RTC/Transport.cpp
浏览文件 @
8be35aee
...
@@ -226,23 +226,34 @@ namespace RTC
...
@@ -226,23 +226,34 @@ namespace RTC
this
->
iceServer
->
Destroy
();
this
->
iceServer
->
Destroy
();
for
(
auto
socket
:
this
->
udpSockets
)
for
(
auto
socket
:
this
->
udpSockets
)
{
socket
->
Destroy
();
socket
->
Destroy
();
}
this
->
udpSockets
.
clear
();
this
->
udpSockets
.
clear
();
for
(
auto
server
:
this
->
tcpServers
)
for
(
auto
server
:
this
->
tcpServers
)
{
server
->
Destroy
();
server
->
Destroy
();
}
this
->
tcpServers
.
clear
();
this
->
tcpServers
.
clear
();
this
->
selectedTuple
=
nullptr
;
this
->
selectedTuple
=
nullptr
;
// Close all the handled Producers
and Consumers
.
// Close all the handled Producers.
for
(
auto
&
producer
:
this
->
producers
)
for
(
auto
it
=
this
->
producers
.
begin
();
it
!=
this
->
producers
.
end
();
)
{
{
auto
*
producer
=
*
it
;
it
=
this
->
producers
.
erase
(
it
);
producer
->
Destroy
();
producer
->
Destroy
();
}
}
for
(
auto
&
consumer
:
this
->
consumers
)
// Close all the handled Consumers.
for
(
auto
it
=
this
->
consumers
.
begin
();
it
!=
this
->
consumers
.
end
();)
{
{
auto
*
consumer
=
*
it
;
it
=
this
->
consumers
.
erase
(
it
);
consumer
->
Destroy
();
consumer
->
Destroy
();
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论