This commit is contained in:
Nikolay Kim 2025-03-16 11:26:18 +01:00
parent 5233d615c8
commit 6ff78925c2
4 changed files with 3 additions and 6 deletions

View file

@ -45,6 +45,8 @@ ntex-util = { path = "ntex-util" }
ntex-compio = { path = "ntex-compio" }
ntex-tokio = { path = "ntex-tokio" }
ntex-neon = { git = "git@github.com:ntex-rs/neon.git" }
[workspace.dependencies]
async-task = "4.5.0"
bitflags = "2"

View file

@ -229,7 +229,6 @@ mod tests {
async fn test_connect() {
let server = ntex::server::test_server(|| {
ntex_service::fn_service(|_| async {
ntex_util::time::sleep(ntex_util::time::Millis(100)).await;
Ok::<_, ()>(()) })
});
@ -244,7 +243,6 @@ mod tests {
let result = srv.connect(format!("{}", server.addr())).await;
assert!(result.is_ok());
println!("1-----------------------------------------");
let msg = Connect::new(format!("{}", server.addr())).set_addrs(vec![
format!("127.0.0.1:{}", server.addr().port() - 1)
.parse()
@ -253,11 +251,9 @@ mod tests {
]);
let result = crate::connect::connect(msg).await;
assert!(result.is_ok());
println!("2-----------------------------------------");
let msg = Connect::new(server.addr());
let result = crate::connect::connect(msg).await;
assert!(result.is_ok());
println!("3-----------------------------------------");
}
}

View file

@ -68,7 +68,6 @@ impl ConnectOps {
let id = self.0.connects.borrow_mut().insert(item);
self.0.api.register(fd, id, Interest::Writable);
Ok(id)
}
}

View file

@ -210,7 +210,7 @@ impl<T> Handler for StreamOpsHandler<T> {
fn close(id: usize, fd: RawFd, api: &DriverApi) -> ntex_rt::JoinHandle<io::Result<i32>> {
api.unregister_all(fd);
ntex_rt::spawn_blocking(move || {
//syscall!(libc::shutdown(fd, libc::SHUT_RDWR))?;
syscall!(libc::shutdown(fd, libc::SHUT_RDWR))?;
syscall!(libc::close(fd))
})
}