SingleUdpSocket::SingleUdpSocket(std::string& ip)
{
MS_TRACE();
this->udpSocket = new RTC::UdpSocket(this, ip);
}
uint16_t SingleUdpSocket::GetLocalPort()
{
return udpSocket->GetLocalPort();
}
IceCandidate(RTC::UdpSocket* udpSocket, uint32_t priority)
: foundation("udpcandidate"), priority(priority), ip(udpSocket->GetLocalIp()),
protocol(Protocol::UDP), port(udpSocket->GetLocalPort()), type(CandidateType::HOST)
{
}
这个端口还是动态分配的啊,发给client的 Candidate端口还是多端口吧
udp通讯每个客户的端口要不一样的。每次连接之前动态分配,并且保存在集合或者数据库,所有客户端要同步端口,否则无法通讯。