-
Notifications
You must be signed in to change notification settings - Fork 29
Conversation
I added a Windows implementation which compiles fine but seems to not be timing out at all. |
In any case, it seems like we'll have proper methods soon-ish: rust-lang/rust#25818. |
Ah nice :-) |
I re-read the manual page for select and noticed I should have done a more extensive check on the return value. Previously, I considered only -1 as indication of an error. However, 0 is also an error:
Now that is fixed, but |
It seems to be working correctly now. :) |
ee736f6
to
cdd26e7
Compare
Test network
Currently, all reads from the underlying UDP are blocking. This raises several problems, such as:
SocketState::FinSent
state indefinitely).This branch pull request creates a sub-crate with a new trait,
WithReadTimeout
, implemented forUdpSocket
, adding the methodrecv_timeout(&mut [u8], i64)
to it. This method is only properly implemented for POSIX targets, with the Windows implementation being a dummy which ignores the timeout.