Support optional addr in accept

This commit is contained in:
Aode (Lion) 2022-02-24 12:02:07 -06:00
parent 0a155a37ae
commit 43222ec623
2 changed files with 2 additions and 2 deletions

View file

@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rustix = "0.33.2"
rustix = "0.33.3"
[dev-dependencies]
read-write-buf = { git = "https://git.asonix.dog/safe-async/read-write-buf" }

View file

@ -27,7 +27,7 @@ pub struct TcpListenerBuilder {
}
impl TcpListener {
pub fn try_accept(&self) -> crate::io::Result<Nonblocking<(TcpStream, SocketAddrAny)>> {
pub fn try_accept(&self) -> crate::io::Result<Nonblocking<(TcpStream, Option<SocketAddrAny>)>> {
nonblocking(
rustix::net::acceptfrom_with(&self.inner, AcceptFlags::NONBLOCK | AcceptFlags::CLOEXEC)
.map(|(inner, addr)| (TcpStream { inner }, addr)),