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

add support for drain #83

Merged
merged 1 commit into from
Aug 9, 2023
Merged

Conversation

polomsky
Copy link
Contributor

@polomsky polomsky commented May 10, 2020

Tested on Mac OS, Linux and Windows with UART emulated on USB.

I wrote general BSD code, because it should work, but I am not able to test it.

On Mac OS I am quite sure that drain behaves as needed.
For Windows it seems that drain is actually part of Write, because Write was slow and Drain was fast. But I have not found any mention in Win32 docs about buffering and asynchronous write, so I kept it.
For Linux Drain is also taking more time than writing.

@wissamalkja
Copy link

great ,,

@smuroff
Copy link

smuroff commented Apr 21, 2021

@wissamalkja could you merge it? I've looked for the same feature.

Tested on Mac OS, Linux and Windows with UART emulated on USB.

I wrote general BSD code, because it should work, but I am not able to test
it.

On Mac OS I am quite sure that drain behaves as expected because it fixed
an issue with buffer overflow (which OS does not report but fails).

For Windows it seems that drain is actually part of `Write`, because
`Write` was long and `Drain` was fast. But I have not found any mention in
Win32 docs about buffering and asynchronous write, so I put there flushing
code to be sure, and this code did not break anything.

For Linux `Drain` is also taking more time than writing so it looks working
too.
@cmaglie cmaglie merged commit ff38fe2 into bugst:master Aug 9, 2023
@cmaglie
Copy link
Member

cmaglie commented Aug 9, 2023

The Linux implementation has been replaced with #159.

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

Successfully merging this pull request may close these issues.

4 participants