void OpenDDS::DCPS::InstanceState::cancel_release() { this->release_pending_ = false; if (this->release_timer_id_ != -1) { ACE_Reactor_Timer_Interface* reactor = this->reader_->get_reactor(); reactor->cancel_timer(this->release_timer_id_); this->release_timer_id_ = -1; } }
void pause() { ACE_Reactor_Timer_Interface* reactor = TheServiceParticipant->timer(); if (reactor->schedule_timer(this, 0, ACE_Time_Value(0,1)) == -1) { ACE_ERROR ((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: PauseReactor, ") ACE_TEXT(" %p. \n"), ACE_TEXT("schedule_timer"))); } }
void OpenDDS::DCPS::InstanceState::schedule_release() { DDS::DataReaderQos qos; this->reader_->get_qos(qos); DDS::Duration_t delay; switch (this->instance_state_) { case DDS::NOT_ALIVE_NO_WRITERS_INSTANCE_STATE: delay = qos.reader_data_lifecycle.autopurge_nowriter_samples_delay; break; case DDS::NOT_ALIVE_DISPOSED_INSTANCE_STATE: delay = qos.reader_data_lifecycle.autopurge_disposed_samples_delay; break; default: ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: InstanceState::schedule_release:") ACE_TEXT(" Unsupported instance state: %d!\n"), this->instance_state_)); return; } if (delay.sec != DDS::DURATION_INFINITE_SEC && delay.nanosec != DDS::DURATION_INFINITE_NSEC) { cancel_release(); ACE_Reactor_Timer_Interface* reactor = this->reader_->get_reactor(); this->release_timer_id_ = reactor->schedule_timer(this, 0, duration_to_time_value(delay)); if (this->release_timer_id_ == -1) { ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: InstanceState::schedule_release:") ACE_TEXT(" Unable to schedule timer!\n"))); } } else { // N.B. instance transitions are always followed by a non-valid // sample being queued to the ReceivedDataElementList; marking // the release as pending prevents this sample from being lost // if all samples have been already removed from the instance. schedule_pending(); } }
void DataLink::transport_shutdown() { DBG_ENTRY_LVL("DataLink", "transport_shutdown", 6); if (!this->send_strategy_.is_nil()) { this->send_strategy_->transport_shutdown(); } //this->cancel_release(); this->set_scheduling_release(false); this->scheduled_to_stop_at_ = ACE_Time_Value::zero; ACE_Reactor_Timer_Interface* reactor = this->impl_->timer(); reactor->cancel_timer(this); this->stop(); // Drop our reference to the TransportImpl object this->impl_ = 0; }