初步支持ipv6: #576, #1406

This commit is contained in:
ziyue
2022-05-07 20:06:08 +08:00
parent 5e08e43e9a
commit 3062ea0e7c
6 changed files with 10 additions and 10 deletions

View File

@@ -292,7 +292,7 @@ void RtspPlayer::handleResSETUP(const Parser &parser, unsigned int track_idx) {
//udp组播
auto multiAddr = transport_map["destination"];
pRtpSockRef = createSocket();
if (!pRtpSockRef->bindUdpSock(rtp_port, "0.0.0.0")) {
if (!pRtpSockRef->bindUdpSock(rtp_port, "::")) {
pRtpSockRef.reset();
throw std::runtime_error("open udp sock err");
}
@@ -303,7 +303,7 @@ void RtspPlayer::handleResSETUP(const Parser &parser, unsigned int track_idx) {
//设置rtcp发送端口
pRtcpSockRef = createSocket();
if (!pRtcpSockRef->bindUdpSock(0, "0.0.0.0")) {
if (!pRtcpSockRef->bindUdpSock(0, "::")) {
//分配端口失败
throw runtime_error("open udp socket failed");
}