Upgrade socket2

This commit is contained in:
Joakim Frostegård 2021-08-15 23:32:59 +02:00
parent 1028dcc709
commit d172fc4f8c
9 changed files with 18 additions and 19 deletions

View file

@ -30,7 +30,7 @@ parking_lot = "0.11"
privdrop = "0.5"
rand = { version = "0.8", features = ["small_rng"] }
serde = { version = "1", features = ["derive"] }
socket2 = { version = "0.3", features = ["reuseport"] }
socket2 = { version = "0.4.1", features = ["all"] }
[dev-dependencies]
quickcheck = "1.0"

View file

@ -88,9 +88,9 @@ pub fn run_socket_worker(
fn create_socket(config: &Config) -> ::std::net::UdpSocket {
let socket = if config.network.address.is_ipv4() {
Socket::new(Domain::ipv4(), Type::dgram(), Some(Protocol::udp()))
Socket::new(Domain::IPV4, Type::DGRAM, Some(Protocol::UDP))
} else {
Socket::new(Domain::ipv6(), Type::dgram(), Some(Protocol::udp()))
Socket::new(Domain::IPV6, Type::DGRAM, Some(Protocol::UDP))
}
.expect("create socket");
@ -116,7 +116,7 @@ fn create_socket(config: &Config) -> ::std::net::UdpSocket {
}
}
socket.into_udp_socket()
socket.into()
}
#[inline]