de-vri-es / serial2-rs

Cross platform serial ports for Rust
Other
41 stars 10 forks source link

Try to provide consistent POSIX-like behaviour on Windows and Unix. #15

Closed de-vri-es closed 9 months ago

de-vri-es commented 9 months ago

This PR tries to make reads on Windows behave like on Unix: read will return with available data as soon as possible instead of trying to fill the entire buffer and then time out if not enough data is available.

Sadly, wine doesn't seem to emulate the time-out behaviour properly. It looks like u32::MAX has no special meaning, so read calls block forever instead of returning as soon as possible like they should :(