avoid using unavailable udp_socket optimizations on ios targets

This commit is contained in:
Anton Lazarev 2021-12-01 20:17:38 -08:00 committed by Michael Vines
parent 60fe1d00e8
commit 9079de825b
1 changed files with 2 additions and 2 deletions

View File

@ -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<Socket> {
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<Socket> {
use nix::sys::socket::setsockopt;
use nix::sys::socket::sockopt::{ReuseAddr, ReusePort};