pub fn handle_timeout(&mut self, now: Instant) {
        for &timer in &Timer::VALUES {
            if !self.timers.is_expired(timer, now) {
                continue;
            }
            self.timers.stop(timer);
            trace!(timer = ?timer, "timeout");
            match timer {
                Timer::Close => {
                    self.state = State::Drained;
                    self.endpoint_events.push_back(EndpointEventInner::Drained);
                }
                Timer::Idle => {
                    self.close_common();
                    self.events.push_back(ConnectionError::TimedOut.into());
                    self.state = State::Drained;
                    self.endpoint_events.push_back(EndpointEventInner::Drained);
                }
                Timer::KeepAlive => {
                    trace!("sending keep-alive");
                    self.ping();
                }
                Timer::LossDetection => {
                    self.on_loss_detection_timeout(now);
                }
                Timer::KeyDiscard => {
                    self.zero_rtt_crypto = None;
                    self.prev_crypto = None;
                }
                Timer::PathValidation => {
                    debug!("path validation failed");
                    if let Some(prev) = self.prev_path.take() {
                        self.path = prev;
                    }
                    self.path.challenge = None;
                    self.path.challenge_pending = false;
                }
            }
        }
    }
/// Process timer expirations
///
/// Executes protocol logic, potentially preparing signals (including application `Event`s,
/// `EndpointEvent`s and outgoing datagrams) that should be extracted through the relevant
/// methods.
Process timer expirations
Executes protocol logic, potentially preparing signals (including application `Event`s,
`EndpointEvent`s and outgoing datagrams) that should be extracted through the relevant
methods.
Process timer expirations Executes protocol logic potentially preparing signals ( including application ` Event ` s ` EndpointEvent ` s and outgoing datagrams ) that should be extracted through the relevant methods .
pub fn handle_timeout(&mut self, now: Instant) {
        for &timer in &Timer::VALUES {
            if !self.timers.is_expired(timer, now) {
                continue;
            }
            self.timers.stop(timer);
            trace!(timer = ?timer, "timeout");
            match timer {
                Timer::Close => {
                    self.state = State::Drained;
                    self.endpoint_events.push_back(EndpointEventInner::Drained);
                }
                Timer::Idle => {
                    self.close_common();
                    self.events.push_back(ConnectionError::TimedOut.into());
                    self.state = State::Drained;
                    self.endpoint_events.push_back(EndpointEventInner::Drained);
                }
                Timer::KeepAlive => {
                    trace!("sending keep-alive");
                    self.ping();
                }
                Timer::LossDetection => {
                    self.on_loss_detection_timeout(now);
                }
                Timer::KeyDiscard => {
                    self.zero_rtt_crypto = None;
                    self.prev_crypto = None;
                }
                Timer::PathValidation => {
                    debug!("path validation failed");
                    if let Some(prev) = self.prev_path.take() {
                        self.path = prev;
                    }
                    self.path.challenge = None;
                    self.path.challenge_pending = false;
                }
            }
        }
    }
pub fn handle_timeout ( & mut self , now : Instant ) { for & timer in & Timer :: VALUES { if ! self . timers . is_expired ( timer , now ) { continue ; } self . timers . stop ( timer ) ; trace ! ( timer timer " " ) ; match timer { Timer :: Close => { self . state = State :: Drained ; self . endpoint_events . push_back ( EndpointEventInner :: Drained ) ; } Timer :: Idle => { self . close_common ( ) ; self . events . push_back ( ConnectionError :: TimedOut . into ( ) ) ; self . state = State :: Drained ; self . endpoint_events . push_back ( EndpointEventInner :: Drained ) ; } Timer :: KeepAlive => { trace ! ( " " ) ; self . ping ( ) ; } Timer :: LossDetection => { self . on_loss_detection_timeout ( now ) ; } Timer :: KeyDiscard => { self . zero_rtt_crypto = None ; self . prev_crypto = None ; } Timer :: PathValidation => { debug ! ( " " ) ; if let Some ( prev ) = self . prev_path . take ( ) { self . path = prev ; } self . path . challenge = None ; self . path . challenge_pending = false ; } } } }
Process timer expirations
Executes protocol logic, potentially preparing signals (including application `Event`s,
`EndpointEvent`s and outgoing datagrams) that should be extracted through the relevant
methods.
Process timer expirations Executes protocol logic potentially preparing signals ( including application ` Event ` s ` EndpointEvent ` s and outgoing datagrams ) that should be extracted through the relevant methods .
&mut self
now
Instant