RJCP.DLL.SerialPortStream
RJCP.DLL.SerialPortStream copied to clipboard
tcdrain or tcflush for flushing
In this https://github.com/dotnet/corefx/commit/45dba6ea7a49a9945a5ad497cfc3de2ec1246683#diff-221055955142c33d285c9271ba435005 .NET Core team replaced tcflush with tcdrain. Maybe SerialPortStream should use tcdrain too, because tcflush discards bytes, but Flush() API should send them.
https://linux.die.net/man/3/tcdrain:
- tcdrain() waits until all output written to the object referred to by fd has been transmitted.
- tcflush() discards data written to the object referred to by fd but not transmitted, or data received but not read