Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
02e7f3c4
提交
02e7f3c4
authored
12月 24, 2015
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Worker: share a single instance of Json::CharReader.
Worker: start Dump() methods. Node: start dump() methods.
上级
6af8e97d
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
312 行增加
和
30 行删除
+312
-30
Channel.js
lib/Channel.js
+4
-1
Peer.js
lib/Peer.js
+29
-0
Room.js
lib/Room.js
+28
-0
Server.js
lib/Server.js
+38
-0
Worker.js
lib/Worker.js
+19
-0
Request.h
worker/include/Channel/Request.h
+5
-2
UnixStreamSocket.h
worker/include/Channel/UnixStreamSocket.h
+1
-0
Logger.h
worker/include/Logger.h
+4
-4
Peer.h
worker/include/RTC/Peer.h
+5
-1
Room.h
worker/include/RTC/Room.h
+5
-1
Request.cpp
worker/src/Channel/Request.cpp
+4
-1
UnixStreamSocket.cpp
worker/src/Channel/UnixStreamSocket.cpp
+15
-3
Loop.cpp
worker/src/Loop.cpp
+85
-0
Peer.cpp
worker/src/RTC/Peer.cpp
+12
-0
Room.cpp
worker/src/RTC/Room.cpp
+49
-0
Settings.cpp
worker/src/Settings.cpp
+8
-8
main.cpp
worker/src/main.cpp
+1
-9
没有找到文件。
lib/Channel.js
浏览文件 @
02e7f3c4
...
@@ -144,7 +144,10 @@ class Channel extends EventEmitter
...
@@ -144,7 +144,10 @@ class Channel extends EventEmitter
}
}
catch
(
error
)
catch
(
error
)
{
{
return
Promise
.
reject
(
errors
.
Closed
(
'channel closed'
));
// TOOD: set .status to the error or not?
error
.
status
=
303
;
return
Promise
.
reject
(
error
);
}
}
promise
=
new
Promise
((
pResolve
,
pReject
)
=>
promise
=
new
Promise
((
pResolve
,
pReject
)
=>
...
...
lib/Peer.js
浏览文件 @
02e7f3c4
...
@@ -61,6 +61,35 @@ class Peer extends EventEmitter
...
@@ -61,6 +61,35 @@ class Peer extends EventEmitter
this
.
emit
(
'close'
,
error
);
this
.
emit
(
'close'
,
error
);
}
}
/**
* Dump the Room
* @return {Promise}
*/
dump
()
{
logger
.
debug
(
'dump()'
);
let
data
=
{
roomId
:
this
.
_roomId
,
peerId
:
this
.
_peerId
};
return
this
.
_channel
.
request
(
'dumpPeer'
,
data
)
.
then
((
data
)
=>
{
logger
.
debug
(
'"dumpPeer" request succeeded'
);
return
data
;
})
.
catch
((
error
)
=>
{
logger
.
error
(
'"dumpPeer" request failed [status:%s, error:"%s"]'
,
error
.
status
,
error
.
message
);
throw
error
;
});
}
}
}
module
.
exports
=
Peer
;
module
.
exports
=
Peer
;
lib/Room.js
浏览文件 @
02e7f3c4
...
@@ -70,6 +70,34 @@ class Room extends EventEmitter
...
@@ -70,6 +70,34 @@ class Room extends EventEmitter
this
.
emit
(
'close'
,
error
);
this
.
emit
(
'close'
,
error
);
}
}
/**
* Dump the Room
* @return {Promise}
*/
dump
()
{
logger
.
debug
(
'dump()'
);
let
data
=
{
roomId
:
this
.
_roomId
};
return
this
.
_channel
.
request
(
'dumpRoom'
,
data
)
.
then
((
data
)
=>
{
logger
.
debug
(
'"dumpRoom" request succeeded'
);
return
data
;
})
.
catch
((
error
)
=>
{
logger
.
error
(
'"dumpRoom" request failed [status:%s, error:"%s"]'
,
error
.
status
,
error
.
message
);
throw
error
;
});
}
/**
/**
* Create a Peer
* Create a Peer
* @param {String} [mandatory] peerId Peer identificator
* @param {String} [mandatory] peerId Peer identificator
...
...
lib/Server.js
浏览文件 @
02e7f3c4
...
@@ -101,6 +101,44 @@ class Server extends EventEmitter
...
@@ -101,6 +101,44 @@ class Server extends EventEmitter
this
.
emit
(
'close'
,
error
);
this
.
emit
(
'close'
,
error
);
}
}
/**
* Dump the Server
* @return {Promise}
*/
dump
()
{
logger
.
debug
(
'dump()'
);
if
(
this
.
_closed
)
return
Promise
.
reject
(
errors
.
Closed
(
'server closed'
));
let
promises
=
[];
this
.
_workers
.
forEach
((
worker
)
=>
{
promises
.
push
(
worker
.
dump
());
});
return
Promise
.
all
(
promises
)
.
then
((
datas
)
=>
{
let
json
=
{
workers
:
{}
};
for
(
let
data
of
datas
)
{
for
(
let
workerId
of
Object
.
keys
(
data
))
{
json
.
workers
[
workerId
]
=
data
[
workerId
];
}
}
return
json
;
});
}
/**
/**
* Update Server settings
* Update Server settings
* @param {Object} options Object with modified settings
* @param {Object} options Object with modified settings
...
...
lib/Worker.js
浏览文件 @
02e7f3c4
...
@@ -137,6 +137,25 @@ class Worker extends EventEmitter
...
@@ -137,6 +137,25 @@ class Worker extends EventEmitter
this
.
emit
(
'close'
,
error
);
this
.
emit
(
'close'
,
error
);
}
}
dump
()
{
logger
.
debug
(
'dump()'
);
return
this
.
_channel
.
request
(
'dumpWorker'
)
.
then
((
data
)
=>
{
logger
.
debug
(
'"dumpWorker" request succeeded'
);
return
data
;
})
.
catch
((
error
)
=>
{
logger
.
error
(
'"dumpWorker" request failed [status:%s, error:"%s"]'
,
error
.
status
,
error
.
message
);
throw
error
;
});
}
updateSettings
(
options
)
updateSettings
(
options
)
{
{
logger
.
debug
(
'updateSettings() [options:%o]'
,
options
);
logger
.
debug
(
'updateSettings() [options:%o]'
,
options
);
...
...
worker/include/Channel/Request.h
浏览文件 @
02e7f3c4
...
@@ -16,11 +16,14 @@ namespace Channel
...
@@ -16,11 +16,14 @@ namespace Channel
public
:
public
:
enum
class
MethodId
enum
class
MethodId
{
{
updateSettings
=
1
,
dumpWorker
=
1
,
updateSettings
,
createRoom
,
createRoom
,
closeRoom
,
closeRoom
,
dumpRoom
,
createPeer
,
createPeer
,
closePeer
closePeer
,
dumpPeer
};
};
private
:
private
:
...
...
worker/include/Channel/UnixStreamSocket.h
浏览文件 @
02e7f3c4
...
@@ -39,6 +39,7 @@ namespace Channel
...
@@ -39,6 +39,7 @@ namespace Channel
// Passed by argument.
// Passed by argument.
Listener
*
listener
=
nullptr
;
Listener
*
listener
=
nullptr
;
// Others.
// Others.
Json
::
CharReader
*
jsonReader
=
nullptr
;
size_t
msgStart
=
0
;
// Where the latest message starts.
size_t
msgStart
=
0
;
// Where the latest message starts.
};
};
}
}
...
...
worker/include/Logger.h
浏览文件 @
02e7f3c4
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
* This macro must point to a unsigned int function, method or variable that
* This macro must point to a unsigned int function, method or variable that
* returns the logging level.
* returns the logging level.
*/
*/
#define MS_
GE
T_LOG_LEVEL Settings::configuration.logLevel
#define MS_
CURREN
T_LOG_LEVEL Settings::configuration.logLevel
class
Logger
class
Logger
{
{
...
@@ -58,7 +58,7 @@ public:
...
@@ -58,7 +58,7 @@ public:
inline
inline
bool
Logger
::
HasDebugLevel
()
bool
Logger
::
HasDebugLevel
()
{
{
return
(
MS_LOG_LEVEL_DEBUG
==
MS_
GE
T_LOG_LEVEL
);
return
(
MS_LOG_LEVEL_DEBUG
==
MS_
CURREN
T_LOG_LEVEL
);
}
}
// NOTE: Each file including Logger.h MUST define its own MS_CLASS macro.
// NOTE: Each file including Logger.h MUST define its own MS_CLASS macro.
...
@@ -90,7 +90,7 @@ bool Logger::HasDebugLevel()
...
@@ -90,7 +90,7 @@ bool Logger::HasDebugLevel()
#define MS_DEBUG(desc, ...) \
#define MS_DEBUG(desc, ...) \
do \
do \
{ \
{ \
if (MS_LOG_LEVEL_DEBUG == MS_
GE
T_LOG_LEVEL) \
if (MS_LOG_LEVEL_DEBUG == MS_
CURREN
T_LOG_LEVEL) \
{ \
{ \
dprintf(Logger::fd, "D" _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR, _MS_LOG_ARG, ##__VA_ARGS__); \
dprintf(Logger::fd, "D" _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR, _MS_LOG_ARG, ##__VA_ARGS__); \
} \
} \
...
@@ -100,7 +100,7 @@ bool Logger::HasDebugLevel()
...
@@ -100,7 +100,7 @@ bool Logger::HasDebugLevel()
#define MS_WARN(desc, ...) \
#define MS_WARN(desc, ...) \
do \
do \
{ \
{ \
if (MS_LOG_LEVEL_WARN <= MS_
GE
T_LOG_LEVEL) \
if (MS_LOG_LEVEL_WARN <= MS_
CURREN
T_LOG_LEVEL) \
{ \
{ \
dprintf(Logger::fd, "W" _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR, _MS_LOG_ARG, ##__VA_ARGS__); \
dprintf(Logger::fd, "W" _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR, _MS_LOG_ARG, ##__VA_ARGS__); \
} \
} \
...
...
worker/include/RTC/Peer.h
浏览文件 @
02e7f3c4
...
@@ -25,6 +25,7 @@ namespace RTC
...
@@ -25,6 +25,7 @@ namespace RTC
void
SendRTPPacket
(
RTC
::
RTPPacket
*
packet
);
void
SendRTPPacket
(
RTC
::
RTPPacket
*
packet
);
void
SendRTCPPacket
(
RTC
::
RTCPPacket
*
packet
);
void
SendRTCPPacket
(
RTC
::
RTCPPacket
*
packet
);
Json
::
Value
Dump
();
void
Close
();
void
Close
();
/* Pure virtual methods inherited from RTC::Transport::Listener. */
/* Pure virtual methods inherited from RTC::Transport::Listener. */
...
@@ -32,10 +33,13 @@ namespace RTC
...
@@ -32,10 +33,13 @@ namespace RTC
virtual
void
onRTPPacket
(
RTC
::
Transport
*
transport
,
RTC
::
RTPPacket
*
packet
)
override
;
virtual
void
onRTPPacket
(
RTC
::
Transport
*
transport
,
RTC
::
RTPPacket
*
packet
)
override
;
virtual
void
onRTCPPacket
(
RTC
::
Transport
*
transport
,
RTC
::
RTCPPacket
*
packet
)
override
;
virtual
void
onRTCPPacket
(
RTC
::
Transport
*
transport
,
RTC
::
RTCPPacket
*
packet
)
override
;
public
:
// Passed by argument.
std
::
string
peerId
;
private
:
private
:
// Passed by argument.
// Passed by argument.
Listener
*
listener
=
nullptr
;
Listener
*
listener
=
nullptr
;
std
::
string
peerId
;
// Others.
// Others.
RTC
::
Transport
*
transport
=
nullptr
;
RTC
::
Transport
*
transport
=
nullptr
;
};
};
...
...
worker/include/RTC/Room.h
浏览文件 @
02e7f3c4
...
@@ -19,6 +19,8 @@ namespace RTC
...
@@ -19,6 +19,8 @@ namespace RTC
void
HandleCreatePeerRequest
(
Channel
::
Request
*
request
);
void
HandleCreatePeerRequest
(
Channel
::
Request
*
request
);
void
HandleClosePeerRequest
(
Channel
::
Request
*
request
);
void
HandleClosePeerRequest
(
Channel
::
Request
*
request
);
void
HandleDumpPeerRequest
(
Channel
::
Request
*
request
);
Json
::
Value
Dump
();
void
Close
();
void
Close
();
private
:
private
:
...
@@ -29,9 +31,11 @@ namespace RTC
...
@@ -29,9 +31,11 @@ namespace RTC
virtual
void
onRTPPacket
(
RTC
::
Peer
*
peer
,
RTC
::
RTPPacket
*
packet
)
override
;
virtual
void
onRTPPacket
(
RTC
::
Peer
*
peer
,
RTC
::
RTPPacket
*
packet
)
override
;
virtual
void
onRTCPPacket
(
RTC
::
Peer
*
peer
,
RTC
::
RTCPPacket
*
packet
)
override
;
virtual
void
onRTCPPacket
(
RTC
::
Peer
*
peer
,
RTC
::
RTCPPacket
*
packet
)
override
;
p
rivate
:
p
ublic
:
// Passed by argument.
// Passed by argument.
unsigned
int
roomId
;
unsigned
int
roomId
;
private
:
// Others.
// Others.
typedef
std
::
unordered_map
<
std
::
string
,
RTC
::
Peer
*>
Peers
;
typedef
std
::
unordered_map
<
std
::
string
,
RTC
::
Peer
*>
Peers
;
Peers
peers
;
Peers
peers
;
...
...
worker/src/Channel/Request.cpp
浏览文件 @
02e7f3c4
...
@@ -14,11 +14,14 @@ namespace Channel
...
@@ -14,11 +14,14 @@ namespace Channel
std
::
unordered_map
<
std
::
string
,
Request
::
MethodId
>
Request
::
string2MethodId
=
std
::
unordered_map
<
std
::
string
,
Request
::
MethodId
>
Request
::
string2MethodId
=
{
{
{
"dumpWorker"
,
Request
::
MethodId
::
dumpWorker
},
{
"updateSettings"
,
Request
::
MethodId
::
updateSettings
},
{
"updateSettings"
,
Request
::
MethodId
::
updateSettings
},
{
"createRoom"
,
Request
::
MethodId
::
createRoom
},
{
"createRoom"
,
Request
::
MethodId
::
createRoom
},
{
"closeRoom"
,
Request
::
MethodId
::
closeRoom
},
{
"closeRoom"
,
Request
::
MethodId
::
closeRoom
},
{
"dumpRoom"
,
Request
::
MethodId
::
dumpRoom
},
{
"createPeer"
,
Request
::
MethodId
::
createPeer
},
{
"createPeer"
,
Request
::
MethodId
::
createPeer
},
{
"closePeer"
,
Request
::
MethodId
::
closePeer
}
{
"closePeer"
,
Request
::
MethodId
::
closePeer
},
{
"dumpPeer"
,
Request
::
MethodId
::
dumpPeer
}
};
};
/* Instance methods. */
/* Instance methods. */
...
...
worker/src/Channel/UnixStreamSocket.cpp
浏览文件 @
02e7f3c4
...
@@ -25,11 +25,23 @@ namespace Channel
...
@@ -25,11 +25,23 @@ namespace Channel
listener
(
listener
)
listener
(
listener
)
{
{
MS_TRACE
();
MS_TRACE
();
Json
::
CharReaderBuilder
builder
;
Json
::
Value
settings
=
Json
::
nullValue
;
Json
::
Value
invalid_settings
;
builder
.
strictMode
(
&
settings
);
MS_ASSERT
(
builder
.
validate
(
&
invalid_settings
),
"invalid Json::CharReaderBuilder"
);
this
->
jsonReader
=
builder
.
newCharReader
();
}
}
UnixStreamSocket
::~
UnixStreamSocket
()
UnixStreamSocket
::~
UnixStreamSocket
()
{
{
MS_TRACE
();
MS_TRACE
();
delete
this
->
jsonReader
;
}
}
void
UnixStreamSocket
::
Send
(
Json
::
Value
&
msg
)
void
UnixStreamSocket
::
Send
(
Json
::
Value
&
msg
)
...
@@ -154,9 +166,9 @@ namespace Channel
...
@@ -154,9 +166,9 @@ namespace Channel
read_len
=
(
const
MS_BYTE
*
)
json_start
-
(
this
->
buffer
+
this
->
msgStart
)
+
json_len
+
1
;
read_len
=
(
const
MS_BYTE
*
)
json_start
-
(
this
->
buffer
+
this
->
msgStart
)
+
json_len
+
1
;
Json
::
Value
json
;
Json
::
Value
json
;
Json
::
Reader
reade
r
;
std
::
string
json_parse_erro
r
;
if
(
reader
.
parse
((
const
char
*
)
json_start
,
(
const
char
*
)
json_start
+
json_len
,
json
))
if
(
this
->
jsonReader
->
parse
((
const
char
*
)
json_start
,
(
const
char
*
)
json_start
+
json_len
,
&
json
,
&
json_parse_error
))
{
{
Channel
::
Request
*
request
=
nullptr
;
Channel
::
Request
*
request
=
nullptr
;
...
@@ -180,7 +192,7 @@ namespace Channel
...
@@ -180,7 +192,7 @@ namespace Channel
}
}
else
else
{
{
MS_ERROR
(
"
invalid JSON"
);
MS_ERROR
(
"
JSON parsing error: %s"
,
json_parse_error
.
c_str
()
);
}
}
// If there is no more space available in the buffer and that is because
// If there is no more space available in the buffer and that is because
...
...
worker/src/Loop.cpp
浏览文件 @
02e7f3c4
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
#include <csignal> // sigfillset, pthread_sigmask()
#include <csignal> // sigfillset, pthread_sigmask()
#include <cstdlib> // std::genenv()
#include <cstdlib> // std::genenv()
#include <cerrno>
#include <cerrno>
#include <json/json.h>
/* Instance methods. */
/* Instance methods. */
...
@@ -134,6 +135,29 @@ void Loop::onChannelRequest(Channel::UnixStreamSocket* channel, Channel::Request
...
@@ -134,6 +135,29 @@ void Loop::onChannelRequest(Channel::UnixStreamSocket* channel, Channel::Request
switch
(
request
->
methodId
)
switch
(
request
->
methodId
)
{
{
case
Channel
:
:
Request
::
MethodId
::
dumpWorker
:
{
MS_DEBUG
(
"'dumpWorker' method"
);
Json
::
Value
json
(
Json
::
objectValue
);
Json
::
Value
jsonWorker
(
Json
::
objectValue
);
Json
::
Value
jsonRooms
(
Json
::
objectValue
);
for
(
auto
&
kv
:
this
->
rooms
)
{
auto
room
=
kv
.
second
;
jsonRooms
[
std
::
to_string
(
room
->
roomId
)]
=
room
->
Dump
();
}
jsonWorker
[
"rooms"
]
=
jsonRooms
;
json
[
Logger
::
id
]
=
jsonWorker
;
request
->
Accept
(
json
);
break
;
}
case
Channel
:
:
Request
::
MethodId
::
updateSettings
:
case
Channel
:
:
Request
::
MethodId
::
updateSettings
:
{
{
MS_DEBUG
(
"'updateSettings' method"
);
MS_DEBUG
(
"'updateSettings' method"
);
...
@@ -221,6 +245,38 @@ void Loop::onChannelRequest(Channel::UnixStreamSocket* channel, Channel::Request
...
@@ -221,6 +245,38 @@ void Loop::onChannelRequest(Channel::UnixStreamSocket* channel, Channel::Request
break
;
break
;
}
}
case
Channel
:
:
Request
::
MethodId
::
dumpRoom
:
{
MS_DEBUG
(
"'dumpRoom' method"
);
RTC
::
Room
*
room
;
unsigned
int
roomId
;
try
{
room
=
GetRoomFromRequest
(
request
,
&
roomId
);
}
catch
(
const
MediaSoupError
&
error
)
{
request
->
Reject
(
500
,
error
.
what
());
return
;
}
if
(
!
room
)
{
MS_ERROR
(
"Room does not exist"
);
request
->
Reject
(
500
,
"Room does not exist"
);
return
;
}
Json
::
Value
jsonRoom
=
room
->
Dump
();
request
->
Accept
(
jsonRoom
);
break
;
}
case
Channel
:
:
Request
::
MethodId
::
createPeer
:
case
Channel
:
:
Request
::
MethodId
::
createPeer
:
{
{
MS_DEBUG
(
"'createPeer' method"
);
MS_DEBUG
(
"'createPeer' method"
);
...
@@ -279,6 +335,35 @@ void Loop::onChannelRequest(Channel::UnixStreamSocket* channel, Channel::Request
...
@@ -279,6 +335,35 @@ void Loop::onChannelRequest(Channel::UnixStreamSocket* channel, Channel::Request
break
;
break
;
}
}
case
Channel
:
:
Request
::
MethodId
::
dumpPeer
:
{
MS_DEBUG
(
"'dumpPeer' method"
);
RTC
::
Room
*
room
;
try
{
room
=
GetRoomFromRequest
(
request
);
}
catch
(
const
MediaSoupError
&
error
)
{
request
->
Reject
(
500
,
error
.
what
());
return
;
}
if
(
!
room
)
{
MS_ERROR
(
"Room does not exist"
);
request
->
Reject
(
500
,
"Room does not exist"
);
return
;
}
room
->
HandleDumpPeerRequest
(
request
);
break
;
}
default
:
default
:
{
{
MS_ABORT
(
"unexpected methodId"
);
MS_ABORT
(
"unexpected methodId"
);
...
...
worker/src/RTC/Peer.cpp
浏览文件 @
02e7f3c4
...
@@ -46,6 +46,18 @@ namespace RTC
...
@@ -46,6 +46,18 @@ namespace RTC
this
->
transport
->
SendRTCPPacket
(
packet
);
this
->
transport
->
SendRTCPPacket
(
packet
);
}
}
Json
::
Value
Peer
::
Dump
()
{
MS_TRACE
();
Json
::
Value
json
(
Json
::
objectValue
);
// TODO: TMP
json
[
"foo"
]
=
"bar"
;
return
json
;
}
void
Peer
::
Close
()
void
Peer
::
Close
()
{
{
MS_TRACE
();
MS_TRACE
();
...
...
worker/src/RTC/Room.cpp
浏览文件 @
02e7f3c4
...
@@ -103,6 +103,55 @@ namespace RTC
...
@@ -103,6 +103,55 @@ namespace RTC
request
->
Accept
();
request
->
Accept
();
}
}
void
Room
::
HandleDumpPeerRequest
(
Channel
::
Request
*
request
)
{
MS_TRACE
();
RTC
::
Peer
*
peer
;
std
::
string
peerId
;
try
{
peer
=
GetPeerFromRequest
(
request
,
&
peerId
);
}
catch
(
const
MediaSoupError
&
error
)
{
request
->
Reject
(
500
,
error
.
what
());
return
;
}
if
(
!
peer
)
{
MS_ERROR
(
"Peer does not exist"
);
request
->
Reject
(
500
,
"Peer does not exist"
);
return
;
}
Json
::
Value
jsonPeer
=
peer
->
Dump
();
request
->
Accept
(
jsonPeer
);
}
Json
::
Value
Room
::
Dump
()
{
MS_TRACE
();
Json
::
Value
json
(
Json
::
objectValue
);
Json
::
Value
jsonPeers
(
Json
::
objectValue
);
for
(
auto
&
kv
:
this
->
peers
)
{
auto
peer
=
kv
.
second
;
jsonPeers
[
peer
->
peerId
]
=
peer
->
Dump
();
}
json
[
"peers"
]
=
jsonPeers
;
return
json
;
}
void
Room
::
Close
()
void
Room
::
Close
()
{
{
MS_TRACE
();
MS_TRACE
();
...
...
worker/src/Settings.cpp
浏览文件 @
02e7f3c4
...
@@ -145,26 +145,26 @@ void Settings::PrintConfiguration()
...
@@ -145,26 +145,26 @@ void Settings::PrintConfiguration()
{
{
MS_TRACE
();
MS_TRACE
();
MS_DEBUG
(
"
[configuration]
"
);
MS_DEBUG
(
"
<configuration>
"
);
MS_DEBUG
(
"
-
logLevel:
\"
%s
\"
"
,
Settings
::
logLevel2String
[
Settings
::
configuration
.
logLevel
].
c_str
());
MS_DEBUG
(
"logLevel:
\"
%s
\"
"
,
Settings
::
logLevel2String
[
Settings
::
configuration
.
logLevel
].
c_str
());
if
(
Settings
::
configuration
.
hasIPv4
)
if
(
Settings
::
configuration
.
hasIPv4
)
MS_DEBUG
(
"
-
rtcListenIPv4:
\"
%s
\"
"
,
Settings
::
configuration
.
rtcListenIPv4
.
c_str
());
MS_DEBUG
(
"rtcListenIPv4:
\"
%s
\"
"
,
Settings
::
configuration
.
rtcListenIPv4
.
c_str
());
else
else
MS_DEBUG
(
"
-
rtcListenIPv4: (unavailable)"
);
MS_DEBUG
(
"rtcListenIPv4: (unavailable)"
);
if
(
Settings
::
configuration
.
hasIPv6
)
if
(
Settings
::
configuration
.
hasIPv6
)
MS_DEBUG
(
"- rtcListenIPv6:
\"
%s
\"
"
,
Settings
::
configuration
.
rtcListenIPv6
.
c_str
());
MS_DEBUG
(
"- rtcListenIPv6:
\"
%s
\"
"
,
Settings
::
configuration
.
rtcListenIPv6
.
c_str
());
else
else
MS_DEBUG
(
"
-
rtcListenIPv6: (unavailable)"
);
MS_DEBUG
(
"rtcListenIPv6: (unavailable)"
);
MS_DEBUG
(
"
-
rtcMinPort: %d"
,
Settings
::
configuration
.
rtcMinPort
);
MS_DEBUG
(
"rtcMinPort: %d"
,
Settings
::
configuration
.
rtcMinPort
);
MS_DEBUG
(
"
-
rtcMaxPort: %d"
,
Settings
::
configuration
.
rtcMaxPort
);
MS_DEBUG
(
"rtcMaxPort: %d"
,
Settings
::
configuration
.
rtcMaxPort
);
if
(
!
Settings
::
configuration
.
dtlsCertificateFile
.
empty
())
if
(
!
Settings
::
configuration
.
dtlsCertificateFile
.
empty
())
{
{
MS_DEBUG
(
"- dtlsCertificateFile:
\"
%s
\"
"
,
Settings
::
configuration
.
dtlsCertificateFile
.
c_str
());
MS_DEBUG
(
"- dtlsCertificateFile:
\"
%s
\"
"
,
Settings
::
configuration
.
dtlsCertificateFile
.
c_str
());
MS_DEBUG
(
"- dtlsPrivateKeyFile:
\"
%s
\"
"
,
Settings
::
configuration
.
dtlsPrivateKeyFile
.
c_str
());
MS_DEBUG
(
"- dtlsPrivateKeyFile:
\"
%s
\"
"
,
Settings
::
configuration
.
dtlsPrivateKeyFile
.
c_str
());
}
}
MS_DEBUG
(
"
[/configuration]
"
);
MS_DEBUG
(
"
</configuration>
"
);
}
}
void
Settings
::
HandleUpdateRequest
(
Channel
::
Request
*
request
)
void
Settings
::
HandleUpdateRequest
(
Channel
::
Request
*
request
)
...
...
worker/src/main.cpp
浏览文件 @
02e7f3c4
...
@@ -26,18 +26,10 @@ static void destroy();
...
@@ -26,18 +26,10 @@ static void destroy();
int
main
(
int
argc
,
char
*
argv
[],
char
**
envp
)
int
main
(
int
argc
,
char
*
argv
[],
char
**
envp
)
{
{
char
**
env
;
for
(
env
=
envp
;
*
env
!=
0
;
env
++
)
{
// printf("%s\n", *env);
}
std
::
string
id
;
if
(
argc
==
1
)
if
(
argc
==
1
)
MS_EXIT_FAILURE
(
"process id must be given as first argument"
);
MS_EXIT_FAILURE
(
"process id must be given as first argument"
);
id
=
std
::
string
(
argv
[
1
]);
std
::
string
id
=
std
::
string
(
argv
[
1
]);
Logger
::
Init
(
id
);
Logger
::
Init
(
id
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论