mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-23 03:10:04 +08:00
确保rtp/rtcp端口偶奇约定:#292
This commit is contained in:
parent
8c46688886
commit
7102b85d67
@ -373,7 +373,7 @@ std::pair<Socket::Ptr, Socket::Ptr> makeSockPair_l(const EventPoller::Ptr &polle
|
|||||||
}
|
}
|
||||||
|
|
||||||
//是否是偶数
|
//是否是偶数
|
||||||
bool even_numbers = pSockRtp->get_local_port() % 2 != 0;
|
bool even_numbers = pSockRtp->get_local_port() % 2 == 0;
|
||||||
auto pSockRtcp = std::make_shared<Socket>(poller);
|
auto pSockRtcp = std::make_shared<Socket>(poller);
|
||||||
if (!pSockRtcp->bindUdpSock(pSockRtp->get_local_port() + (even_numbers ? 1 : -1), local_ip.data())) {
|
if (!pSockRtcp->bindUdpSock(pSockRtp->get_local_port() + (even_numbers ? 1 : -1), local_ip.data())) {
|
||||||
//分配端口失败
|
//分配端口失败
|
||||||
|
Loading…
Reference in New Issue
Block a user