From 1b730ac8fc988cae69bb0a9b3cdd4cffab38ec38 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Tue, 21 Oct 2003 22:12:43 +0000 Subject: [PATCH] fixedsearch interval computation --- src/ca/searchTimer.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ca/searchTimer.cpp b/src/ca/searchTimer.cpp index ebd3e6ce6..e8fe8e996 100644 --- a/src/ca/searchTimer.cpp +++ b/src/ca/searchTimer.cpp @@ -34,8 +34,6 @@ static const unsigned maxSearchTries = 100u; // max tries on unchanged net static const unsigned initialTriesPerFrame = 1u; // initial UDP frames per search try static const unsigned maxTriesPerFrame = 64u; // max UDP frames per search try -static const double minRoundTripEstimate = 100e-6; // seconds -static const double maxRoundTripEstimate = 5.0; // seconds static const double minSearchPeriod = 30e-3; // seconds static const double maxSearchPeriod = 5.0; // seconds @@ -103,9 +101,10 @@ void searchTimer::recomputeTimerPeriod ( ( tsMin ( this->minRetry, maxSearchTries + 1u ) ); unsigned idelay = 1u << tsMin ( retry, CHAR_BIT * sizeof ( idelay ) - 1u ); - this->period = idelay * this->iiu.roundTripDelayEstimate ( guard ) * 2.0; /* sec */ + double delayFactor = tsMax ( + this->iiu.roundTripDelayEstimate ( guard ) * 2.0, minSearchPeriod ); + this->period = idelay * delayFactor; /* sec */ this->period = tsMin ( maxSearchPeriod, this->period ); - this->period = tsMax ( minSearchPeriod, this->period ); } void searchTimer::recomputeTimerPeriodAndStartTimer ( epicsGuard < udpMutex > & guard,