have domain server remove dead agents from list

This commit is contained in:
Stephen Birarda 2013-02-22 13:43:29 -08:00
parent b4184562e0
commit 92f5c88ab7
2 changed files with 5 additions and 2 deletions

View file

@ -67,7 +67,8 @@ int main(int argc, const char * argv[])
sockaddr_in agentPublicAddress, agentLocalAddress;
agentLocalAddress.sin_family = AF_INET;
agentList.startSilentAgentRemovalThread();
while (true) {
if (agentList.getAgentSocket()->receive((sockaddr *)&agentPublicAddress, packetData, &receivedBytes)) {
@ -83,6 +84,7 @@ int main(int argc, const char * argv[])
}
}
}
return 0;
}

View file

@ -153,7 +153,8 @@ bool AgentList::addOrUpdateAgent(sockaddr *publicSocket, sockaddr *localSocket,
return true;
} else {
// we had this agent already
// we had this agent already, just update receive timestamp
agent->lastRecvTimeUsecs = usecTimestampNow();
return false;
}
}