Skip to content
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

set COMMTIMEOUTS for POSIX-like read timeout behavior on Windows #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

carstenandrich
Copy link

The current read timeout behavior implemented by serial-windows differs significantly from the read timeouts of serial-unix. On Windows, read calls do not return immediately when bytes are/become available, but instead wait for the timeout to expire. In contrast, on Linux (tested, but should be true for all POSIX systems) read calls return as soon as bytes are available. Particularly for interactive implementations, the Windows behavior is suboptimal.

This pull request implements the POSIX-behavior on Windows by setting up COMMTIMEOUTS accordingly (see Windows API documentation).

@dcuddeback
Copy link
Owner

@carstenandrich Thanks. The Windows implementation is intended to behave the same as the POSIX implementation. I'll need to find some time to setup a Windows VM to reproduce and verify the fix. If everything checks out, I can merge this.

@RisinT96
Copy link

Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants