Remove selective reconnecting behavior

We want to remove the partial reconnecting behavior, so that all endpoints of
a zone try to connect to a lower or higher zone in hierarchy.

fixes #9406

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
This commit is contained in:
Markus Frosch 2015-06-11 23:02:13 +02:00 committed by Michael Friedrich
parent 4e664470b5
commit 97f48759cd
1 changed files with 31 additions and 42 deletions

View File

@ -367,7 +367,6 @@ void ApiListener::ApiTimerHandler(void)
}
}
if (IsMaster()) {
Zone::Ptr my_zone = Zone::GetLocalZone();
BOOST_FOREACH(const Zone::Ptr& zone, DynamicType::GetObjectsByType<Zone>()) {
@ -378,22 +377,6 @@ void ApiListener::ApiTimerHandler(void)
continue;
}
bool connected = false;
BOOST_FOREACH(const Endpoint::Ptr& endpoint, zone->GetEndpoints()) {
if (endpoint->IsConnected()) {
connected = true;
break;
}
}
/* don't connect to an endpoint if we already have a connection to the zone */
if (connected) {
Log(LogDebug, "ApiListener")
<< "Not connecting to Zone '" << zone->GetName() << "' because we're already connected to it.";
continue;
}
BOOST_FOREACH(const Endpoint::Ptr& endpoint, zone->GetEndpoints()) {
/* don't connect to ourselves */
if (endpoint->GetName() == GetIdentity()) {
@ -416,11 +399,17 @@ void ApiListener::ApiTimerHandler(void)
continue;
}
/* don't try to connect if we're already connected */
if (endpoint->IsConnected()) {
Log(LogDebug, "ApiListener")
<< "Not connecting to Endpoint '" << endpoint->GetName() << "' because we're already connected to it.";
continue;
}
boost::thread thread(boost::bind(&ApiListener::AddConnection, this, endpoint));
thread.detach();
}
}
}
BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjectsByType<Endpoint>()) {
if (!endpoint->IsConnected())