From ff07576d964546725c304138a422880c69316b4e Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 14 Sep 2017 19:25:16 +0200 Subject: [PATCH] Reply to string requests. --- client/TracyProfiler.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 ); + } } } }