diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 20844e00..6dd3009c 100755 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -1,5 +1,12 @@ +#ifdef _MSC_VER +# include +#else +# include +#endif + #include #include +#include #include "../common/tracy_lz4.hpp" #include "../common/TracyProtocol.hpp" @@ -82,6 +89,10 @@ void Profiler::Worker() { enum { BulkSize = TargetFrameSize / QueueItemSize }; + timeval tv; + tv.tv_sec = 0; + tv.tv_usec = 10000; + moodycamel::ConsumerToken token( m_queue ); ListenSocket listen; @@ -128,6 +139,13 @@ void Profiler::Worker() { std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) ); } + + while( m_sock->HasData() ) + { + uint64_t ptr; + if( !m_sock->Read( &ptr, sizeof( ptr ), &tv, ShouldExit ) ) break; + SendString( ptr ); + } } } }