1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Don't block when polling for broadcast messages.

This commit is contained in:
Bartosz Taudul
2020-09-20 22:06:28 +02:00
parent 59a481451b
commit 0814812e9b
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -726,14 +726,14 @@ void UdpListen::Close()
m_sock = -1;
}
const char* UdpListen::Read( size_t& len, IpAddress& addr )
const char* UdpListen::Read( size_t& len, IpAddress& addr, int timeout )
{
static char buf[2048];
struct pollfd fd;
fd.fd = (socket_t)m_sock;
fd.events = POLLIN;
if( poll( &fd, 1, 10 ) <= 0 ) return nullptr;
if( poll( &fd, 1, timeout ) <= 0 ) return nullptr;
sockaddr sa;
socklen_t salen = sizeof( struct sockaddr );