mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-12 19:24:22 +08:00
Updated Home (markdown)
25
Home.md
25
Home.md
@@ -55,30 +55,7 @@
|
||||
proxyMap.emplace(string(url),player);
|
||||
}
|
||||
```
|
||||
# 为什么VLC播放一段时间就停止了?
|
||||
由于ZLMediaKit在实现RTSP协议时,采用OPTIONS命令作为心跳包(在RTP over UDP时有效),如果播放器不持续发送OPTIONS指令,那么ZLMediaKit会断开连接。
|
||||
如果你要用第三方播放器测试,你可以改RTP over TCP方式或者修改ZLMediaKit的源码,修改位置位置为
|
||||
src/Rtsp/RtspSession.cpp RtspSession::onManager函数,修改成如下所示:
|
||||
```
|
||||
void RtspSession::onManager() {
|
||||
if (m_ticker.createdTime() > 10 * 1000) {
|
||||
if (m_strSession.size() == 0) {
|
||||
WarnL << "非法链接:" << getPeerIp();
|
||||
shutdown();
|
||||
return;
|
||||
}
|
||||
if (m_bListenPeerUdpPort) {
|
||||
UDPServer::Instance().stopListenPeer(getPeerIp().data(), this);
|
||||
m_bListenPeerUdpPort = false;
|
||||
}
|
||||
}
|
||||
/*if (m_rtpType != PlayerBase::RTP_TCP && m_ticker.elapsedTime() > 15 * 1000) {
|
||||
WarnL << "RTSP会话超时:" << getPeerIp();
|
||||
shutdown();
|
||||
return;
|
||||
/*}
|
||||
}
|
||||
```
|
||||
|
||||
# 怎么测试服务器性能?
|
||||
ZLMediaKit提供了测试性能的示例,代码在tests/test_benchmark.cpp。由于ZLTookKit默认关闭了tcp客户端多线程的支持,如果需要提高测试并发量,需要在编译ZLToolKit时启用ENABLE_ASNC_TCP_CLIENT宏,具体操作如下:
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user