#include <ReliableSession.h>
Inheritance diagram for OpenDDS::DCPS::NakWatchdog:
Public Member Functions | |
NakWatchdog (ACE_Reactor *reactor, ACE_thread_t owner, ReliableSession *session) | |
virtual bool | reactor_is_shut_down () const |
Protected Member Functions | |
virtual ACE_Time_Value | next_interval () |
virtual void | on_interval (const void *arg) |
Private Member Functions | |
~NakWatchdog () | |
Private Attributes | |
ReliableSession * | session_ |
Definition at line 26 of file ReliableSession.h.
OpenDDS::DCPS::NakWatchdog::NakWatchdog | ( | ACE_Reactor * | reactor, | |
ACE_thread_t | owner, | |||
ReliableSession * | session | |||
) | [explicit] |
Definition at line 26 of file ReliableSession.cpp.
00029 : DataLinkWatchdog(reactor, owner) 00030 , session_(session) 00031 { 00032 }
OpenDDS::DCPS::NakWatchdog::~NakWatchdog | ( | ) | [inline, private] |
ACE_Time_Value OpenDDS::DCPS::NakWatchdog::next_interval | ( | ) | [protected, virtual] |
Implements OpenDDS::DCPS::DataLinkWatchdog.
Definition at line 35 of file ReliableSession.cpp.
References OpenDDS::DCPS::MulticastDataLink::config(), OpenDDS::DCPS::MulticastSession::link(), OpenDDS::DCPS::MulticastInst::nak_interval_, and session_.
00036 { 00037 MulticastInst* config = this->session_->link()->config(); 00038 ACE_Time_Value interval(config->nak_interval_); 00039 00040 // Apply random backoff to minimize potential collisions: 00041 interval *= static_cast<double>(std::rand()) / 00042 static_cast<double>(RAND_MAX) + 1.0; 00043 00044 return interval; 00045 }
void OpenDDS::DCPS::NakWatchdog::on_interval | ( | const void * | arg | ) | [protected, virtual] |
Implements OpenDDS::DCPS::DataLinkWatchdog.
Definition at line 48 of file ReliableSession.cpp.
References OpenDDS::DCPS::ReliableSession::expire_naks(), OpenDDS::DCPS::ReliableSession::send_naks(), and session_.
00049 { 00050 // Expire outstanding repair requests that have not yet been 00051 // fulfilled; this prevents NAK implosions due to remote 00052 // peers becoming unresponsive: 00053 this->session_->expire_naks(); 00054 00055 // Initiate repairs by sending MULTICAST_NAK control samples 00056 // to remote peers from which we are missing data: 00057 this->session_->send_naks(); 00058 }
bool OpenDDS::DCPS::NakWatchdog::reactor_is_shut_down | ( | ) | const [virtual] |
Implements OpenDDS::DCPS::ReactorInterceptor.
Definition at line 77 of file ReliableSession.cpp.
References OpenDDS::DCPS::TransportImpl::is_shut_down(), OpenDDS::DCPS::MulticastSession::link(), session_, and OpenDDS::DCPS::MulticastDataLink::transport().
00078 { 00079 return session_->link()->transport()->is_shut_down(); 00080 }
Definition at line 41 of file ReliableSession.h.
Referenced by next_interval(), on_interval(), and reactor_is_shut_down().