Remove neon::net dep (#523)

This commit is contained in:
Nikolay Kim 2025-03-14 15:13:31 +05:00 committed by GitHub
parent 9a8a2b3216
commit 81eaf88752
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 179 additions and 183 deletions

View file

@ -1,7 +1,7 @@
use std::os::fd::{AsRawFd, RawFd};
use std::{cell::Cell, collections::VecDeque, io, rc::Rc, task, task::Poll};
use ntex_neon::driver::op::{close_socket, Handler, Interest};
use ntex_neon::driver::{AsRawFd, DriverApi, RawFd};
use ntex_neon::driver::{DriverApi, Handler, Interest};
use ntex_neon::{syscall, Runtime};
use slab::Slab;
@ -211,7 +211,11 @@ impl<T> StreamCtl<T> {
self.with(|streams| (streams[self.id].io.take(), streams[self.id].fd));
if let Some(io) = io {
std::mem::forget(io);
close_socket(fd).await?;
ntex_rt::spawn_blocking(move || syscall!(libc::close(fd)))
.await
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))
.and_then(crate::helpers::pool_io_err)?;
}
Ok(())
}