Broadcast client activity time.

This commit is contained in:
Bartosz Taudul 2019-06-18 20:46:12 +02:00
parent 1a32edebf2
commit 5309e6d94a
2 changed files with 4 additions and 1 deletions

View File

@ -1143,10 +1143,12 @@ void Profiler::Worker()
if( m_broadcast )
{
auto t = std::chrono::high_resolution_clock::now().time_since_epoch().count();
const auto t = std::chrono::high_resolution_clock::now().time_since_epoch().count();
if( t - lastBroadcast > 3000000000 ) // 3s
{
lastBroadcast = t;
const auto ts = std::chrono::duration_cast<std::chrono::seconds>( std::chrono::system_clock::now().time_since_epoch() ).count();
broadcastMsg.activeTime = ts - m_epoch;
m_broadcast->Send( 8086, &broadcastMsg, broadcastLen );
}
}

View File

@ -85,6 +85,7 @@ struct BroadcastMessage
{
uint32_t broadcastVersion;
uint32_t protocolVersion;
uint32_t activeTime; // in seconds
char programName[WelcomeMessageProgramNameSize];
};