Support optional addr in accept
This commit is contained in:
parent
0a155a37ae
commit
43222ec623
|
@ -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" }
|
||||
|
|
|
@ -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)),
|
||||
|
|
Loading…
Reference in a new issue