mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
Upgrade socket2
This commit is contained in:
parent
1028dcc709
commit
d172fc4f8c
9 changed files with 18 additions and 19 deletions
|
|
@ -33,7 +33,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"] }
|
||||
tungstenite = "0.13"
|
||||
|
||||
[dev-dependencies]
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ use super::connection::*;
|
|||
|
||||
pub fn create_listener(config: &Config) -> ::anyhow::Result<::std::net::TcpListener> {
|
||||
let builder = if config.network.address.is_ipv4() {
|
||||
Socket::new(Domain::ipv4(), Type::stream(), Some(Protocol::tcp()))
|
||||
Socket::new(Domain::IPV4, Type::STREAM, Some(Protocol::TCP))
|
||||
} else {
|
||||
Socket::new(Domain::ipv6(), Type::stream(), Some(Protocol::tcp()))
|
||||
Socket::new(Domain::IPV6, Type::STREAM, Some(Protocol::TCP))
|
||||
}
|
||||
.context("Couldn't create socket2::Socket")?;
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ pub fn create_listener(config: &Config) -> ::anyhow::Result<::std::net::TcpListe
|
|||
.listen(128)
|
||||
.context("Couldn't listen for connections on socket")?;
|
||||
|
||||
Ok(builder.into_tcp_listener())
|
||||
Ok(builder.into())
|
||||
}
|
||||
|
||||
pub fn remove_connection_if_exists(poll: &mut Poll, connections: &mut ConnectionMap, token: Token) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue