pub fn on_timeout(&mut self) {
        let now = time::Instant::now();

        if let Some(draining_timer) = self.draining_timer {
            if draining_timer <= now {
                trace!("{} draining timeout expired", self.trace_id);

                qlog_with!(self.qlog_streamer, q, {
                    q.finish_log().ok();
                });

                self.closed = true;
            }

            // Draining timer takes precedence over all other timers. If it is
            // set it means the connection is closing so there's no point in
            // processing the other timers.
            return;
        }

        if let Some(timer) = self.idle_timer {
            if timer <= now {
                trace!("{} idle timeout expired", self.trace_id);

                qlog_with!(self.qlog_streamer, q, {
                    q.finish_log().ok();
                });

                self.closed = true;
                return;
            }
        }

        if let Some(timer) = self.recovery.loss_detection_timer() {
            if timer <= now {
                trace!("{} loss detection timeout expired", self.trace_id);

                self.recovery.on_loss_detection_timeout(
                    self.handshake_status(),
                    now,
                    &self.trace_id,
                );

                qlog_with!(self.qlog_streamer, q, {
                    let ev = self.recovery.to_qlog();
                    q.add_event(ev).ok();
                });

                return;
            }
        }
    }
/// Processes a timeout event.
///
/// If no timeout has occurred it does nothing.
Processes a timeout event.
If no timeout has occurred it does nothing.
Processes a timeout event . If no timeout has occurred it does nothing .
pub fn on_timeout(&mut self) {
        let now = time::Instant::now();
        if let Some(draining_timer) = self.draining_timer {
            if draining_timer <= now {
                trace!("{} draining timeout expired", self.trace_id);
                qlog_with!(self.qlog_streamer, q, {
                    q.finish_log().ok();
                });
                self.closed = true;
            }
            // Draining timer takes precedence over all other timers. If it is
            // set it means the connection is closing so there's no point in
            // processing the other timers.
            return;
        }
        if let Some(timer) = self.idle_timer {
            if timer <= now {
                trace!("{} idle timeout expired", self.trace_id);
                qlog_with!(self.qlog_streamer, q, {
                    q.finish_log().ok();
                });
                self.closed = true;
                return;
            }
        }
        if let Some(timer) = self.recovery.loss_detection_timer() {
            if timer <= now {
                trace!("{} loss detection timeout expired", self.trace_id);
                self.recovery.on_loss_detection_timeout(
                    self.handshake_status(),
                    now,
                    &self.trace_id,
                );
                qlog_with!(self.qlog_streamer, q, {
                    let ev = self.recovery.to_qlog();
                    q.add_event(ev).ok();
                });
                return;
            }
        }
    }
pub fn on_timeout ( & mut self ) { let now = time :: Instant :: now ( ) ; if let Some ( draining_timer ) = self . draining_timer { if draining_timer <= now { trace ! ( " " self trace_id ) ; qlog_with ! ( self qlog_streamer q { q finish_log ( ) ok ( ) } ) ; self . closed = true ; } // Draining timer takes precedence over all other timers. If it is // set it means the connection is closing so there's no point in // processing the other timers. return ; } if let Some ( timer ) = self . idle_timer { if timer <= now { trace ! ( " " self trace_id ) ; qlog_with ! ( self qlog_streamer q { q finish_log ( ) ok ( ) } ) ; self . closed = true ; return ; } } if let Some ( timer ) = self . recovery . loss_detection_timer ( ) { if timer <= now { trace ! ( " " self trace_id ) ; self . recovery . on_loss_detection_timeout ( self . handshake_status ( ) , now , & self . trace_id , ) ; qlog_with ! ( self qlog_streamer q { let ev self recovery to_qlog ( ) q add_event ( ev ) ok ( ) } ) ; return ; } } }
Processes a timeout event.
Processes a timeout event .
&mut self
&mut self