From 593ce7404285fb5ed50d5ad8fd541596888ec112 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 20 Sep 2020 22:19:10 +0200 Subject: [PATCH] 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. --- client/TracyProfiler.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 97b0e3c5..f5c65274 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -1373,6 +1373,11 @@ void Profiler::Worker() #ifndef TRACY_NO_EXIT if( !m_noExit && ShouldExit() ) { + if( m_broadcast ) + { + broadcastMsg.activeTime = -1; + m_broadcast->Send( broadcastPort, &broadcastMsg, broadcastLen ); + } m_shutdownFinished.store( true, std::memory_order_relaxed ); return; } @@ -1397,6 +1402,13 @@ void Profiler::Worker() } } + if( m_broadcast ) + { + lastBroadcast = 0; + broadcastMsg.activeTime = -1; + m_broadcast->Send( broadcastPort, &broadcastMsg, broadcastLen ); + } + // Handshake { char shibboleth[HandshakeShibbolethSize];