eliminate the UDP send thread
This commit is contained in:
@@ -14,15 +14,25 @@
|
||||
|
||||
#include "iocinf.h"
|
||||
|
||||
repeaterSubscribeTimer::repeaterSubscribeTimer (udpiiu &iiuIn, osiTimerQueue &queueIn) :
|
||||
osiTimer (queueIn), iiu (iiuIn)
|
||||
repeaterSubscribeTimer::repeaterSubscribeTimer ( udpiiu &iiuIn, osiTimerQueue &queueIn ) :
|
||||
osiTimer ( 10.0, queueIn ), iiu ( iiuIn ), attempts ( 0 ), registered ( false ), once (false)
|
||||
{
|
||||
}
|
||||
|
||||
void repeaterSubscribeTimer::expire ()
|
||||
{
|
||||
this->iiu.contactRepeater = 1u;
|
||||
semBinaryGive (this->iiu.xmitSignal);
|
||||
static const unsigned nTriesToMsg = 50;
|
||||
this->attempts++;
|
||||
|
||||
if ( this->attempts > nTriesToMsg && ! this->once ) {
|
||||
ca_printf (
|
||||
"Unable to contact CA repeater after %u tries\n", nTriesToMsg);
|
||||
ca_printf (
|
||||
"Silence this message by starting a CA repeater daemon\n");
|
||||
this->once = true;
|
||||
}
|
||||
|
||||
this->iiu.repeaterRegistrationMessage ( this->attempts );
|
||||
}
|
||||
|
||||
void repeaterSubscribeTimer::destroy ()
|
||||
@@ -31,17 +41,12 @@ void repeaterSubscribeTimer::destroy ()
|
||||
|
||||
bool repeaterSubscribeTimer::again () const
|
||||
{
|
||||
if (this->iiu.repeaterContacted) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
return ( ! this->registered );
|
||||
}
|
||||
|
||||
double repeaterSubscribeTimer::delay () const
|
||||
{
|
||||
return REPEATER_TRY_PERIOD;
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
void repeaterSubscribeTimer::show (unsigned /* level */ ) const
|
||||
@@ -53,3 +58,7 @@ const char *repeaterSubscribeTimer::name () const
|
||||
return "repeaterSubscribeTimer";
|
||||
}
|
||||
|
||||
void repeaterSubscribeTimer::confirmNotify ()
|
||||
{
|
||||
this->registered = true;
|
||||
}
|
||||
Reference in New Issue
Block a user