mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-25 20:27:34 +08:00
修复openRtpServer开启tcp模式后打开端口失败的bug
两次监听同个tcp端口将导致打开tcp模式失败
This commit is contained in:
parent
08d86c498e
commit
ebde21a314
@ -161,7 +161,7 @@ void RtpServer::start(uint16_t local_port, const string &stream_id, TcpMode tcp_
|
|||||||
if (local_port == 0) {
|
if (local_port == 0) {
|
||||||
//随机端口,rtp端口采用偶数
|
//随机端口,rtp端口采用偶数
|
||||||
auto pair = std::make_pair(rtp_socket, rtcp_socket);
|
auto pair = std::make_pair(rtp_socket, rtcp_socket);
|
||||||
makeSockPair(pair, local_ip, re_use_port, TcpMode::NONE == tcp_mode);
|
makeSockPair(pair, local_ip, re_use_port);
|
||||||
local_port = rtp_socket->get_local_port();
|
local_port = rtp_socket->get_local_port();
|
||||||
} else if (!rtp_socket->bindUdpSock(local_port, local_ip, re_use_port)) {
|
} else if (!rtp_socket->bindUdpSock(local_port, local_ip, re_use_port)) {
|
||||||
//用户指定端口
|
//用户指定端口
|
||||||
|
Loading…
Reference in New Issue
Block a user