Skip to content

Async<TcpListener>::accept removes interest on drop, and no poll_* based alternative #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Darksonn opened this issue Sep 28, 2020 · 1 comment

Comments

@Darksonn
Copy link

The source of async-std has the following snippet:

impl<'a> Stream for Incoming<'a> {
    type Item = io::Result<TcpStream>;

    fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
        let future = self.0.accept();
        pin_utils::pin_mut!(future);

        let (socket, _) = futures_core::ready!(future.poll(cx))?;
        Poll::Ready(Some(Ok(socket)))
    }
}

link

In the latest release of async-io, the accept future was changed to release interest when the future is dropped, which breaks the above implementation. And as far as I can see, there's no poll_* based alternative for waiting for read-readiness on the Async type.

Originally reported to async-std as async-rs/async-std#888

@ghost
Copy link

ghost commented Sep 28, 2020

Thanks for the report! Fixed by async-rs/async-std#889

@ghost ghost closed this as completed Sep 28, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant