From b9ef225420012464ee837055ef98eae3d36a8a32 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 11 Sep 2013 07:49:43 +0200 Subject: [PATCH] Revert "Revert "cluster: Disconnect timed out endpoints."" This reverts commit 0cab8827311db265a8458236ef97b3f9640e9ca8. --- components/cluster/clustercomponent.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/components/cluster/clustercomponent.cpp b/components/cluster/clustercomponent.cpp index 220548b89..fdb36ac01 100644 --- a/components/cluster/clustercomponent.cpp +++ b/components/cluster/clustercomponent.cpp @@ -450,6 +450,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()) { + if (!endpoint->IsConnected() || endpoint->GetSeen() > Utility::GetTime() - 60) + continue; + + Stream::Ptr client = endpoint->GetClient(); + + if (client) + client->Close(); + } + Array::Ptr peers = GetPeers(); if (!peers)