diff --git a/src/udp.rs b/src/udp.rs index ef19585..e9038fd 100644 --- a/src/udp.rs +++ b/src/udp.rs @@ -10,6 +10,11 @@ pub fn is_transient_udp_error(err: &std::io::Error) -> bool { std::io::ErrorKind::Interrupted | std::io::ErrorKind::TimedOut | std::io::ErrorKind::WouldBlock + | std::io::ErrorKind::ConnectionRefused + | std::io::ErrorKind::ConnectionReset + | std::io::ErrorKind::AddrNotAvailable + | std::io::ErrorKind::NetworkUnreachable + | std::io::ErrorKind::HostUnreachable ) || err.raw_os_error().is_some_and(is_transient_udp_os_error) } @@ -129,6 +134,11 @@ mod tests { std::io::ErrorKind::Interrupted, std::io::ErrorKind::TimedOut, std::io::ErrorKind::WouldBlock, + std::io::ErrorKind::ConnectionRefused, + std::io::ErrorKind::ConnectionReset, + std::io::ErrorKind::AddrNotAvailable, + std::io::ErrorKind::NetworkUnreachable, + std::io::ErrorKind::HostUnreachable, ] { let err = std::io::Error::from(kind); assert!(is_transient_udp_error(&err));