uses std::net::IpAddr type for Packet.Meta.addr

This commit is contained in:
behzad nouri
2022-01-02 11:13:57 -05:00
parent aa9f7ed7e8
commit 73a7741c49
4 changed files with 27 additions and 42 deletions

View File

@ -12,7 +12,7 @@ use {
std::{
cmp::Reverse,
collections::HashMap,
net::UdpSocket,
net::{IpAddr, UdpSocket},
sync::{
atomic::{AtomicBool, Ordering},
mpsc::{Receiver, RecvTimeoutError, SendError, Sender},
@ -130,14 +130,14 @@ struct SendStats {
#[derive(Default)]
struct StreamerSendStats {
host_map: HashMap<[u16; 8], SendStats>,
host_map: HashMap<IpAddr, SendStats>,
since: Option<Instant>,
}
impl StreamerSendStats {
fn report_stats(
name: &'static str,
host_map: HashMap<[u16; 8], SendStats>,
host_map: HashMap<IpAddr, SendStats>,
sample_duration: Option<Duration>,
) {
const MAX_REPORT_ENTRIES: usize = 5;