From 102006964621dda5093c5546cd950d1eb40403dc Mon Sep 17 00:00:00 2001 From: hawkeyexp Date: Tue, 29 Jan 2019 19:38:11 +0100 Subject: [PATCH] Experimental: Allow higher ping/pong diff --- src/autoapp/Service/Pinger.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/autoapp/Service/Pinger.cpp b/src/autoapp/Service/Pinger.cpp index fd0b45d..0d7ae56 100644 --- a/src/autoapp/Service/Pinger.cpp +++ b/src/autoapp/Service/Pinger.cpp @@ -17,6 +17,7 @@ */ #include +#include namespace f1x { @@ -50,6 +51,7 @@ void Pinger::ping(Promise::Pointer promise) else { ++pingsCount_; + OPENAUTO_LOG(info) << "[Pinger] Ping counter: " << pingsCount_; promise_ = std::move(promise); timer_.expires_from_now(boost::posix_time::milliseconds(duration_)); @@ -62,6 +64,7 @@ void Pinger::pong() { strand_.dispatch([this, self = this->shared_from_this()]() { ++pongsCount_; + OPENAUTO_LOG(info) << "[Pinger] Pong counter: " << pongsCount_; }); } @@ -75,7 +78,7 @@ void Pinger::onTimerExceeded(const boost::system::error_code& error) { promise_->reject(aasdk::error::Error(aasdk::error::ErrorCode::OPERATION_ABORTED)); } - else if(pingsCount_ - pongsCount_ > 1) + else if(pingsCount_ - pongsCount_ > 4) { promise_->reject(aasdk::error::Error()); }