void HealthCheckedConnection::UpdateReceiveTimer() { TimeInterval timeout_interval(static_cast<int>( 2.5 * m_heartbeat_interval.AsInt())); m_receive_timeout_id = m_scheduler->RegisterSingleTimeout( timeout_interval, NewSingleCallback(this, &HealthCheckedConnection::HeartbeatTimeout)); }
int Heartbeat_Application::register_for_timeouts (void) { // Schedule timeout every 0.5 seconds, for sending heartbeat events. ACE_Time_Value timeout_interval (0, 500000); ACE_Reactor *reactor = this->orb_->orb_core ()->reactor (); if (!reactor || reactor->schedule_timer (&this->timeout_handler_, 0, timeout_interval, timeout_interval) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "Heartbeat_Application::register_for_timeouts - " "cannot schedule timer\n"), -1); } return 0; }