From e58cf16041ffd61e20cefc31571fc938176bcd09 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 13 Jun 2002 23:32:39 +0000 Subject: [PATCH] correct logic surrounding search timer schedualing flags --- src/ca/searchTimer.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/ca/searchTimer.cpp b/src/ca/searchTimer.cpp index 3c810cb94..c3a3eb65d 100644 --- a/src/ca/searchTimer.cpp +++ b/src/ca/searchTimer.cpp @@ -154,7 +154,7 @@ void searchTimer::setRetryInterval ( unsigned retryNo ) void searchTimer::notifySearchResponse ( unsigned short retrySeqNoIn, const epicsTime & currentTime ) { - bool reschedualNeeded; + bool reschedualNeeded = false; { epicsGuard < udpMutex > locker ( this->mutex ); @@ -167,14 +167,16 @@ void searchTimer::notifySearchResponse ( unsigned short retrySeqNoIn, if ( retrySeqNoIn == this->retrySeqNo && ! this->noDelay ) { double curRTT = currentTime - this->timeAtLastRetry; - this->roundTripDelayEstimate = - ( this->roundTripDelayEstimate + curRTT ) / 2.0; - this->period = this->roundTripDelayEstimate * 2.0; - this->period = tsMin ( maxSearchPeriod, this->period ); - this->period = tsMax ( minSearchPeriod, this->period ); - reschedualNeeded = true; - this->active = true; - this->noDelay = true; + if ( curRTT >= 10.0e-6 ) { + this->roundTripDelayEstimate = + ( this->roundTripDelayEstimate + curRTT ) / 2.0; + this->period = this->roundTripDelayEstimate * 2.0; + this->period = tsMin ( maxSearchPeriod, this->period ); + this->period = tsMax ( minSearchPeriod, this->period ); + reschedualNeeded = true; + this->active = true; + this->noDelay = true; + } } if ( this->searchResponses == this->searchAttempts ) { @@ -182,9 +184,6 @@ void searchTimer::notifySearchResponse ( unsigned short retrySeqNoIn, this->active = true; this->noDelay = true; } - else { - reschedualNeeded = false; - } } if ( reschedualNeeded ) {