-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
try_io() of UDPSocket doesn't work on Windows #4510
Comments
@masa-koz did this previously work on 1.16.1? |
@Noah-Kennedy I've just tried this on 1.16.1, but it does'n work, too. |
I find that I should call libc::recvfrom() in do_io() on Windows. Now, I'm suggesting to add do_io() in mio::net::UDPSocket. |
@masa-koz so that fixed your issue? |
@Noah-Kennedy Yes. my test code works expectedly after I change try_io as below.
|
@masa-koz can we close this again or is there something here that you think is actionable in tokio? |
I don't mind closing this now. If there's any progress in mio, I would like to reopen this. |
Since mio 0.8.1, there are try_io methods on TCPStream, UDPSocket, UnixStream, and UnixDatagram. So, try_io methods on tokio should call these methods internally, I think. If acceptable, I will create PR. |
Yes, please open a PR for that. |
A user defined I/O closure should be called by mio's try_io to ensure that the I/O receives more events if it hits a WouldBlock error. Fixes: tokio-rs#4510
A user defined I/O closure should be called by mio's try_io to ensure that the I/O receives more events if it hits a WouldBlock error. Fixes: tokio-rs#4510
Version
└── tokio v1.17.0
└── tokio-macros v1.7.0 (proc-macro)
Platform
Windows 10 64bit
Description
I'm trying to use try_io() of UDPSocket for using WSARecvMsg() with tokio. But the following code doesn't work properly on Windows.
On Linux, it works as expected.
I tried this code:
I expected to see this happen:
Instead, this happened:
It seems that readable() never returns even though many udp packets should arrive.
The text was updated successfully, but these errors were encountered: