diff --git a/Cargo.lock b/Cargo.lock index 9c892e4..d2b5ef5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -856,7 +856,6 @@ dependencies = [ "rkvm-input", "serde", "sha2", - "socket2 0.5.3", "thiserror", "tokio", "tracing", @@ -1026,16 +1025,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "socket2" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" -dependencies = [ - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "spin" version = "0.5.2" @@ -1130,7 +1119,7 @@ dependencies = [ "num_cpus", "pin-project-lite", "signal-hook-registry", - "socket2 0.4.9", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] diff --git a/rkvm-client/src/client.rs b/rkvm-client/src/client.rs index 7e65258..3b862c6 100644 --- a/rkvm-client/src/client.rs +++ b/rkvm-client/src/client.rs @@ -2,7 +2,7 @@ use rkvm_input::writer::Writer; use rkvm_net::auth::{AuthChallenge, AuthStatus}; use rkvm_net::message::Message; use rkvm_net::version::Version; -use rkvm_net::{socket, Update}; +use rkvm_net::Update; use std::collections::hash_map::Entry; use std::collections::HashMap; use std::io; @@ -40,8 +40,6 @@ pub async fn run( _ => unimplemented!("Unhandled rustls ServerName variant: {:?}", hostname), }; - socket::configure(&stream).map_err(Error::Network)?; - tracing::info!("Connected to server"); let stream = connector diff --git a/rkvm-net/Cargo.toml b/rkvm-net/Cargo.toml index 9970354..363cd97 100644 --- a/rkvm-net/Cargo.toml +++ b/rkvm-net/Cargo.toml @@ -16,5 +16,4 @@ thiserror = "1.0.40" hmac = "0.12.1" sha2 = "0.10.6" rand = "0.8.5" -socket2 = { version = "0.5.3", features = ["all"] } tracing = "0.1.37" diff --git a/rkvm-net/src/lib.rs b/rkvm-net/src/lib.rs index 7d93e0f..32d339e 100644 --- a/rkvm-net/src/lib.rs +++ b/rkvm-net/src/lib.rs @@ -1,6 +1,5 @@ pub mod auth; pub mod message; -pub mod socket; pub mod version; use rkvm_input::abs::{AbsAxis, AbsInfo}; diff --git a/rkvm-net/src/socket.rs b/rkvm-net/src/socket.rs deleted file mode 100644 index 585161e..0000000 --- a/rkvm-net/src/socket.rs +++ /dev/null @@ -1,18 +0,0 @@ -use socket2::{SockRef, TcpKeepalive}; -use std::io::Error; -use std::time::Duration; -use tokio::net::TcpStream; - -pub fn configure(stream: &TcpStream) -> Result<(), Error> { - stream.set_linger(None)?; - stream.set_nodelay(false)?; - - SockRef::from(&stream).set_tcp_keepalive( - &TcpKeepalive::new() - .with_time(Duration::from_secs(1)) - .with_interval(Duration::from_secs(10)) - .with_retries(1), - )?; - - Ok(()) -} diff --git a/rkvm-server/src/server.rs b/rkvm-server/src/server.rs index 99fa531..5f3a143 100644 --- a/rkvm-server/src/server.rs +++ b/rkvm-server/src/server.rs @@ -7,7 +7,7 @@ use rkvm_input::sync::SyncEvent; use rkvm_net::auth::{AuthChallenge, AuthResponse, AuthStatus}; use rkvm_net::message::Message; use rkvm_net::version::Version; -use rkvm_net::{socket, Update}; +use rkvm_net::Update; use slab::Slab; use std::collections::{HashMap, HashSet, VecDeque}; use std::ffi::CString; @@ -292,8 +292,6 @@ async fn client( password: &str, ) -> Result<(), ClientError> { let negotiate = async { - socket::configure(&stream)?; - let stream = acceptor.accept(stream).await?; tracing::info!("TLS connected");