From d95d3eba3b979cf6453881ad6cf8f183283e5661 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 7 Jun 2013 15:35:17 -0700 Subject: [PATCH] hook audio-mixer up to new domain server check in method --- audio-mixer/src/main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/audio-mixer/src/main.cpp b/audio-mixer/src/main.cpp index 718dae9757..c9ea474354 100644 --- a/audio-mixer/src/main.cpp +++ b/audio-mixer/src/main.cpp @@ -80,7 +80,6 @@ int main(int argc, const char* argv[]) { agentList->linkedDataCreateCallback = attachNewBufferToAgent; agentList->startSilentAgentRemovalThread(); - agentList->startDomainServerCheckInThread(); unsigned char* packetData = new unsigned char[MAX_PACKET_SIZE]; @@ -99,7 +98,16 @@ int main(int argc, const char* argv[]) { gettimeofday(&startTime, NULL); + timeval lastDomainServerCheckIn = {}; + while (true) { + + // send a check in packet to the domain server if DOMAIN_SERVER_CHECK_IN_USECS has elapsed + if (usecTimestampNow() - usecTimestamp(&lastDomainServerCheckIn) >= DOMAIN_SERVER_CHECK_IN_USECS) { + gettimeofday(&lastDomainServerCheckIn, NULL); + AgentList::getInstance()->sendDomainServerCheckIn(); + } + for (AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) { PositionalAudioRingBuffer* positionalRingBuffer = (PositionalAudioRingBuffer*) agent->getLinkedData();