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

Asynchronous callbacks for reading and writing on Windows, attempt 2. #1328

Merged
merged 1 commit into from
Sep 7, 2017

Commits on Sep 6, 2017

  1. Asynchronous callbacks for reading and writing on Windows, attempt 2.

    Instead of ReadFile and WriteFile, which block and transfer data synchronously, use ReadFileEx and WriteFileEx, which both allow async callbacks. In addition, change how timeouts are used for ReadFile*, using an unlimited timeout for the first byte, and no timeout for the rest of the data in the input buffer. This removes the need to poll entirely, while still retrieving all data available in the input buffer. In both cases, the I/O operations happen in their own threads, since Windows requires IOCompletion callbacks to wait for their calling thread to be in an "alertable wait state".
    
    Fixes serialport#1221
    dustmop committed Sep 6, 2017
    Configuration menu
    Copy the full SHA
    4cc435c View commit details
    Browse the repository at this point in the history