Reply to string requests.

This commit is contained in:
Bartosz Taudul 2017-09-14 19:25:16 +02:00
parent f61f50385d
commit ff07576d96

View File

@ -1,5 +1,12 @@
#ifdef _MSC_VER
# include <winsock2.h>
#else
# include <sys/time.h>
#endif
#include <assert.h>
#include <memory>
#include <limits>
#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 );
}
}
}
}