diff --git a/net-utils/src/lib.rs b/net-utils/src/lib.rs index 7a12aab69f..497e08b523 100644 --- a/net-utils/src/lib.rs +++ b/net-utils/src/lib.rs @@ -372,13 +372,13 @@ pub fn is_host_port(string: String) -> Result<(), String> { parse_host_port(&string).map(|_| ()) } -#[cfg(windows)] +#[cfg(any(windows, target_os = "ios"))] fn udp_socket(_reuseaddr: bool) -> io::Result { let sock = Socket::new(Domain::IPV4, Type::DGRAM, None)?; Ok(sock) } -#[cfg(not(windows))] +#[cfg(not(any(windows, target_os = "ios")))] fn udp_socket(reuseaddr: bool) -> io::Result { use nix::sys::socket::setsockopt; use nix::sys::socket::sockopt::{ReuseAddr, ReusePort};