mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-04 21:37:58 +03:00
wip
This commit is contained in:
parent
5233d615c8
commit
6ff78925c2
4 changed files with 3 additions and 6 deletions
|
@ -45,6 +45,8 @@ ntex-util = { path = "ntex-util" }
|
||||||
ntex-compio = { path = "ntex-compio" }
|
ntex-compio = { path = "ntex-compio" }
|
||||||
ntex-tokio = { path = "ntex-tokio" }
|
ntex-tokio = { path = "ntex-tokio" }
|
||||||
|
|
||||||
|
ntex-neon = { git = "git@github.com:ntex-rs/neon.git" }
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
async-task = "4.5.0"
|
async-task = "4.5.0"
|
||||||
bitflags = "2"
|
bitflags = "2"
|
||||||
|
|
|
@ -229,7 +229,6 @@ mod tests {
|
||||||
async fn test_connect() {
|
async fn test_connect() {
|
||||||
let server = ntex::server::test_server(|| {
|
let server = ntex::server::test_server(|| {
|
||||||
ntex_service::fn_service(|_| async {
|
ntex_service::fn_service(|_| async {
|
||||||
ntex_util::time::sleep(ntex_util::time::Millis(100)).await;
|
|
||||||
Ok::<_, ()>(()) })
|
Ok::<_, ()>(()) })
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -244,7 +243,6 @@ mod tests {
|
||||||
let result = srv.connect(format!("{}", server.addr())).await;
|
let result = srv.connect(format!("{}", server.addr())).await;
|
||||||
assert!(result.is_ok());
|
assert!(result.is_ok());
|
||||||
|
|
||||||
println!("1-----------------------------------------");
|
|
||||||
let msg = Connect::new(format!("{}", server.addr())).set_addrs(vec![
|
let msg = Connect::new(format!("{}", server.addr())).set_addrs(vec![
|
||||||
format!("127.0.0.1:{}", server.addr().port() - 1)
|
format!("127.0.0.1:{}", server.addr().port() - 1)
|
||||||
.parse()
|
.parse()
|
||||||
|
@ -253,11 +251,9 @@ mod tests {
|
||||||
]);
|
]);
|
||||||
let result = crate::connect::connect(msg).await;
|
let result = crate::connect::connect(msg).await;
|
||||||
assert!(result.is_ok());
|
assert!(result.is_ok());
|
||||||
println!("2-----------------------------------------");
|
|
||||||
|
|
||||||
let msg = Connect::new(server.addr());
|
let msg = Connect::new(server.addr());
|
||||||
let result = crate::connect::connect(msg).await;
|
let result = crate::connect::connect(msg).await;
|
||||||
assert!(result.is_ok());
|
assert!(result.is_ok());
|
||||||
println!("3-----------------------------------------");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,6 @@ impl ConnectOps {
|
||||||
let id = self.0.connects.borrow_mut().insert(item);
|
let id = self.0.connects.borrow_mut().insert(item);
|
||||||
|
|
||||||
self.0.api.register(fd, id, Interest::Writable);
|
self.0.api.register(fd, id, Interest::Writable);
|
||||||
|
|
||||||
Ok(id)
|
Ok(id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,7 +210,7 @@ impl<T> Handler for StreamOpsHandler<T> {
|
||||||
fn close(id: usize, fd: RawFd, api: &DriverApi) -> ntex_rt::JoinHandle<io::Result<i32>> {
|
fn close(id: usize, fd: RawFd, api: &DriverApi) -> ntex_rt::JoinHandle<io::Result<i32>> {
|
||||||
api.unregister_all(fd);
|
api.unregister_all(fd);
|
||||||
ntex_rt::spawn_blocking(move || {
|
ntex_rt::spawn_blocking(move || {
|
||||||
//syscall!(libc::shutdown(fd, libc::SHUT_RDWR))?;
|
syscall!(libc::shutdown(fd, libc::SHUT_RDWR))?;
|
||||||
syscall!(libc::close(fd))
|
syscall!(libc::close(fd))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue