FACT++  1.0
void ConnectionBias::DelayedReconnect ( )
inlineprivate

Definition at line 307 of file biasctrl.cc.

308  {
309  const Time now;
310 
311  // If we have been connected without a diconnect for at least 60s
312  // we can reset the delay.
313  if (now-fLastConnect>boost::posix_time::seconds(60))
314  fReconnectDelay = 1;
315 
316  ostringstream msg;
317  msg << "Automatic reconnect in " << fReconnectDelay << "s after being connected for ";
318  msg << (now-fLastConnect).seconds() << "s";
319  Info(msg);
320 
321  CloseImp(fReconnectDelay);
322  fReconnectDelay *= 2;
323  }
void CloseImp(int64_t delay=0)
Adds some functionality to boost::posix_time::ptime for our needs.
Definition: Time.h:30
Time fLastConnect
Definition: biasctrl.cc:65
int Info(const std::string &str)
Definition: MessageImp.h:47
uint32_t fReconnectDelay
Definition: biasctrl.cc:57