correct logic surrounding search timer schedualing flags

This commit is contained in:
Jeff Hill
2002-06-13 23:32:39 +00:00
parent c331dd6951
commit e58cf16041

View File

@@ -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 ) {