mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
对端端口未打开,udp得到connection refused的错误而关闭。
This commit is contained in:
parent
a871fc1882
commit
0a19627d86
@ -140,7 +140,7 @@ void RtpSender::startSend(const MediaSourceEvent::SendRtpArgs &args, const funct
|
|||||||
cb(0, SockException(Err_other, ex.what()));
|
cb(0, SockException(Err_other, ex.what()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
strong_self->_socket_rtp->bindPeerAddr((struct sockaddr *)&addr);
|
strong_self->_socket_rtp->bindPeerAddr((struct sockaddr *)&addr, 0, true);
|
||||||
strong_self->onConnect();
|
strong_self->onConnect();
|
||||||
cb(strong_self->_socket_rtp->get_local_port(), SockException());
|
cb(strong_self->_socket_rtp->get_local_port(), SockException());
|
||||||
});
|
});
|
||||||
@ -182,7 +182,7 @@ void RtpSender::createRtcpSocket() {
|
|||||||
case AF_INET6: ((sockaddr_in6 *)&addr)->sin6_port = htons(ntohs(((sockaddr_in6 *)&addr)->sin6_port) + 1); break;
|
case AF_INET6: ((sockaddr_in6 *)&addr)->sin6_port = htons(ntohs(((sockaddr_in6 *)&addr)->sin6_port) + 1); break;
|
||||||
default: assert(0); break;
|
default: assert(0); break;
|
||||||
}
|
}
|
||||||
_socket_rtcp->bindPeerAddr((struct sockaddr *)&addr);
|
_socket_rtcp->bindPeerAddr((struct sockaddr *)&addr, 0, true);
|
||||||
|
|
||||||
_rtcp_context = std::make_shared<RtcpContextForSend>();
|
_rtcp_context = std::make_shared<RtcpContextForSend>();
|
||||||
weak_ptr<RtpSender> weak_self = shared_from_this();
|
weak_ptr<RtpSender> weak_self = shared_from_this();
|
||||||
|
Loading…
Reference in New Issue
Block a user