pub fn record_pong(&mut self, nonce: u64) -> Option<u32> {
        self.inc_pongs_received();

        match self.inflight_pings.remove_entry(&nonce) {
            Some((_, (node_id, sent_time))) => {
                let now = Utc::now().naive_utc();
                let latency = self
                    .add_latency_sample(node_id, convert_to_std_duration(now - sent_time))
                    .calc_average();
                Some(latency)
            },
            None => None,
        }
    }
/// Records a pong. Specifically, the pong counter is incremented and
/// a latency sample is added and calculated.
Records a pong. Specifically, the pong counter is incremented and
a latency sample is added and calculated.
Records a pong . Specifically the pong counter is incremented and a latency sample is added and calculated .
pub fn record_pong(&mut self, nonce: u64) -> Option<u32> {
        self.inc_pongs_received();
        match self.inflight_pings.remove_entry(&nonce) {
            Some((_, (node_id, sent_time))) => {
                let now = Utc::now().naive_utc();
                let latency = self
                    .add_latency_sample(node_id, convert_to_std_duration(now - sent_time))
                    .calc_average();
                Some(latency)
            },
            None => None,
        }
    }
pub fn record_pong ( & mut self , nonce : u64 ) -> Option < u32 > { self . inc_pongs_received ( ) ; match self . inflight_pings . remove_entry ( & nonce ) { Some ( ( _ , ( node_id , sent_time ) ) ) => { let now = Utc :: now ( ) . naive_utc ( ) ; let latency = self . add_latency_sample ( node_id , convert_to_std_duration ( now - sent_time ) ) . calc_average ( ) ; Some ( latency ) } , None => None , } }
Records a pong.
Records a pong .
&mut self
nonce
u64
&mut self
nonce
u64