Require longer delays before disconnecting peers

This commit is contained in:
JoelKatz
2015-06-22 04:23:56 -07:00
committed by Vinnie Falco
parent 7d96075e14
commit 4c0de726c8
2 changed files with 15 additions and 4 deletions

View File

@@ -537,6 +537,17 @@ PeerImp::onTimer (error_code const& ec)
send (std::make_shared<Message> (
message, protocol::mtPING));
}
else
{
// We have an outstanding ping, raise latency
auto minLatency = std::chrono::duration_cast <std::chrono::milliseconds>
(clock_type::now() - lastPingTime_);
std::lock_guard<std::mutex> sl(recentLock_);
if (latency_ < minLatency)
latency_ = minLatency;
}
setTimer();
}

View File

@@ -54,16 +54,16 @@ enum
checkSeconds = 10,
/** How often we latency/sendq probe connections */
timerSeconds = 3,
timerSeconds = 4,
/** How many timer intervals a sendq has to stay large before we disconnect */
sendqIntervals = 3,
sendqIntervals = 4,
/** How many timer intervals we can go without a ping reply */
noPing = 4,
noPing = 10,
/** How many messages on a send queue before we refuse queries */
dropSendQueue = 5,
dropSendQueue = 8,
/** How many messages we consider reasonable sustained on a send queue */
targetSendQueue = 16,