diff --git a/ntex-compio/CHANGES.md b/ntex-compio/CHANGES.md index 2f89245c..e31f8cc6 100644 --- a/ntex-compio/CHANGES.md +++ b/ntex-compio/CHANGES.md @@ -1,5 +1,9 @@ # Changes +## [0.2.1] - 2024-10-31 + +* It's not required to close compio sockets explicitly #444 + ## [0.2.0] - 2024-09-24 * Update to compio v0.12 diff --git a/ntex-compio/Cargo.toml b/ntex-compio/Cargo.toml index f51c7ec1..4799ff8f 100644 --- a/ntex-compio/Cargo.toml +++ b/ntex-compio/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ntex-compio" -version = "0.2.0" +version = "0.2.1" authors = ["ntex contributors "] description = "compio runtime intergration for ntex framework" keywords = ["network", "framework", "async", "futures"] diff --git a/ntex-compio/src/io.rs b/ntex-compio/src/io.rs index c27e6759..8e80c860 100644 --- a/ntex-compio/src/io.rs +++ b/ntex-compio/src/io.rs @@ -9,14 +9,7 @@ use ntex_io::{types, Handle, IoStream, ReadContext, WriteContext, WriteContextBu impl IoStream for crate::TcpStream { fn start(self, read: ReadContext, write: WriteContext) -> Option> { let io = self.0.clone(); - compio::runtime::spawn(async move { - run(io.clone(), &read, write).await; - match io.close().await { - Ok(_) => log::debug!("{} Stream is closed", read.tag()), - Err(e) => log::error!("{} Stream is closed, {:?}", read.tag(), e), - } - }) - .detach(); + compio::runtime::spawn(async move { run(io.clone(), &read, write).await }).detach(); Some(Box::new(HandleWrapper(self.0))) } @@ -25,14 +18,8 @@ impl IoStream for crate::TcpStream { #[cfg(unix)] impl IoStream for crate::UnixStream { fn start(self, read: ReadContext, write: WriteContext) -> Option> { - compio::runtime::spawn(async move { - run(self.0.clone(), &read, write).await; - match self.0.close().await { - Ok(_) => log::debug!("{} Unix stream is closed", read.tag()), - Err(e) => log::error!("{} Unix stream is closed, {:?}", read.tag(), e), - } - }) - .detach(); + compio::runtime::spawn(async move { run(self.0.clone(), &read, write).await }) + .detach(); None }