Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Nov 17, 2023
1 parent c558a6e commit 61c2bf5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
20 changes: 12 additions & 8 deletions ntex-io/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,6 @@ impl<F> Io<F> {
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<io::Error> {
self.0 .0.error.take()
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 3 additions & 0 deletions ntex-io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<BytesCodec>::KeepAlive).contains("KeepAlive"));
}
}

0 comments on commit 61c2bf5

Please sign in to comment.