From 61c2bf513a099fd6ef3079f56ec43481c7713b3f Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Fri, 17 Nov 2023 19:04:32 +0600 Subject: [PATCH] wip --- ntex-io/src/io.rs | 20 ++++++++++++-------- ntex-io/src/lib.rs | 3 +++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ntex-io/src/io.rs b/ntex-io/src/io.rs index b70acb4e1..303647649 100644 --- a/ntex-io/src/io.rs +++ b/ntex-io/src/io.rs @@ -280,13 +280,6 @@ impl Io { self.0.clone() } - #[inline] - #[doc(hidden)] - #[deprecated] - pub fn remove_keepalive_timer(&self) { - self.stop_keepalive_timer() - } - /// Get current io error fn error(&self) -> Option { self.0 .0.error.take() @@ -930,12 +923,23 @@ mod tests { use crate::testing::IoTest; #[ntex::test] - async fn test_recv() { + async fn test_basics() { let (client, server) = IoTest::create(); client.remote_buffer_cap(1024); let server = Io::new(server); assert!(server.eq(&server)); + assert!(server.0.eq(&server.0)); + + assert!(format!("{:?}", Flags::IO_STOPPED).contains("IO_STOPPED")); + } + + #[ntex::test] + async fn test_recv() { + let (client, server) = IoTest::create(); + client.remote_buffer_cap(1024); + + let server = Io::new(server); server.0 .0.notify_timeout(); let err = server.recv(&BytesCodec).await.err().unwrap(); diff --git a/ntex-io/src/lib.rs b/ntex-io/src/lib.rs index 767760255..a5b976645 100644 --- a/ntex-io/src/lib.rs +++ b/ntex-io/src/lib.rs @@ -219,5 +219,8 @@ mod tests { format!("{:?}", T::KeepAliveTimeout).contains("DispatchItem::KeepAliveTimeout") ); assert!(format!("{:?}", T::ReadTimeout).contains("DispatchItem::ReadTimeout")); + + assert!(format!("{:?}", IoStatusUpdate::KeepAlive).contains("KeepAlive")); + assert!(format!("{:?}", RecvError::::KeepAlive).contains("KeepAlive")); } }