Notify servers that client is no longer listening for connections.

This happens in these two cases:
- The client is exiting.
- A connection attempt is performed.

This message type is indicated by negative time value.
This commit is contained in:
Bartosz Taudul 2020-09-20 22:19:10 +02:00
parent 5c826c2723
commit 593ce74042

View File

@ -1373,6 +1373,11 @@ void Profiler::Worker()
#ifndef TRACY_NO_EXIT #ifndef TRACY_NO_EXIT
if( !m_noExit && ShouldExit() ) if( !m_noExit && ShouldExit() )
{ {
if( m_broadcast )
{
broadcastMsg.activeTime = -1;
m_broadcast->Send( broadcastPort, &broadcastMsg, broadcastLen );
}
m_shutdownFinished.store( true, std::memory_order_relaxed ); m_shutdownFinished.store( true, std::memory_order_relaxed );
return; return;
} }
@ -1397,6 +1402,13 @@ void Profiler::Worker()
} }
} }
if( m_broadcast )
{
lastBroadcast = 0;
broadcastMsg.activeTime = -1;
m_broadcast->Send( broadcastPort, &broadcastMsg, broadcastLen );
}
// Handshake // Handshake
{ {
char shibboleth[HandshakeShibbolethSize]; char shibboleth[HandshakeShibbolethSize];