From 0a7d413e83d39d30eb7a91ea3856131040828463 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 15 Sep 2017 22:44:50 +0200 Subject: [PATCH] select() may update timeval. --- common/TracySocket.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/TracySocket.cpp b/common/TracySocket.cpp index 81738d7f..c44f9d43 100755 --- a/common/TracySocket.cpp +++ b/common/TracySocket.cpp @@ -119,7 +119,12 @@ int Socket::Recv( void* _buf, int len, const timeval* tv ) FD_ZERO( &fds ); FD_SET( m_sock, &fds ); +#ifndef _WIN32 + timeval _tv = *tv; + select( m_sock+1, &fds, nullptr, nullptr, &_tv ); +#else select( m_sock+1, &fds, nullptr, nullptr, tv ); +#endif if( FD_ISSET( m_sock, &fds ) ) { return recv( m_sock, buf, len, 0 );