mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-30 01:04:36 +00:00
Also no need to construct more than one welcome message.
This commit is contained in:
parent
5421164f33
commit
652dccd163
@ -155,23 +155,8 @@ void Profiler::Worker()
|
||||
const auto procname = GetProcessName();
|
||||
const auto pnsz = std::min<size_t>( strlen( procname ), WelcomeMessageProgramNameSize - 1 );
|
||||
|
||||
moodycamel::ConsumerToken token( s_queue );
|
||||
|
||||
ListenSocket listen;
|
||||
listen.Listen( "8086", 8 );
|
||||
|
||||
while( m_timeBegin.load( std::memory_order_relaxed ) == 0 ) std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
|
||||
|
||||
for(;;)
|
||||
{
|
||||
for(;;)
|
||||
{
|
||||
if( ShouldExit() ) return;
|
||||
m_sock = listen.Accept();
|
||||
if( m_sock ) break;
|
||||
}
|
||||
|
||||
{
|
||||
WelcomeMessage welcome;
|
||||
#ifdef DISABLE_LZ4
|
||||
// notify client that lz4 compression is disabled (too slow in debug builds)
|
||||
@ -188,9 +173,21 @@ void Profiler::Worker()
|
||||
memcpy( welcome.programName, procname, pnsz );
|
||||
memset( welcome.programName + pnsz, 0, WelcomeMessageProgramNameSize - pnsz );
|
||||
|
||||
m_sock->Send( &welcome, sizeof( welcome ) );
|
||||
moodycamel::ConsumerToken token( s_queue );
|
||||
|
||||
ListenSocket listen;
|
||||
listen.Listen( "8086", 8 );
|
||||
|
||||
for(;;)
|
||||
{
|
||||
for(;;)
|
||||
{
|
||||
if( ShouldExit() ) return;
|
||||
m_sock = listen.Accept();
|
||||
if( m_sock ) break;
|
||||
}
|
||||
|
||||
m_sock->Send( &welcome, sizeof( welcome ) );
|
||||
LZ4_resetStream( m_stream );
|
||||
|
||||
for(;;)
|
||||
|
Loading…
Reference in New Issue
Block a user