Fix TRACE bug and new UDP socket code issue.
This commit is contained in:
parent
15e8c18106
commit
4d0ad9abb6
3 changed files with 10 additions and 10 deletions
|
@ -93,13 +93,11 @@ bool UdpSocket::notifyAvailableForRead(const SharedPtr<Socket> &self,SocketManag
|
|||
{
|
||||
Buffer<ZT_SOCKET_MAX_MESSAGE_LEN> buf;
|
||||
InetAddress from;
|
||||
for(;;) {
|
||||
socklen_t salen = from.saddrSpaceLen();
|
||||
int n = (int)recvfrom(_sock,buf.data(),ZT_SOCKET_MAX_MESSAGE_LEN,0,from.saddr(),&salen);
|
||||
if (n > 0) {
|
||||
buf.setSize((unsigned int)n);
|
||||
sm->handleReceivedPacket(self,from,buf);
|
||||
} else break;
|
||||
socklen_t salen = from.saddrSpaceLen();
|
||||
int n = (int)recvfrom(_sock,buf.data(),ZT_SOCKET_MAX_MESSAGE_LEN,0,from.saddr(),&salen);
|
||||
if (n > 0) {
|
||||
buf.setSize((unsigned int)n);
|
||||
sm->handleReceivedPacket(self,from,buf);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue