cluster: Disconnect timed out endpoints.

This commit is contained in:
Gunnar Beutner 2013-09-03 16:51:49 +02:00
parent 558daf7b84
commit 1f74139ab4
1 changed files with 11 additions and 0 deletions

View File

@ -410,6 +410,17 @@ void ClusterComponent::ClusterTimerHandler(void)
RelayMessage(Endpoint::Ptr(), message, false);
/* check if we've recently seen heartbeat messages from our peers */
BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjects<Endpoint>()) {
if (!endpoint->IsConnected() || endpoint->GetSeen() > Utility::GetTime() - 60)
continue;
Stream::Ptr client = endpoint->GetClient();
if (client)
client->Close();
}
Array::Ptr peers = GetPeers();
if (!peers)