Skip to content

Commit

Permalink
fix: remove PURGE_RXABORT flag on flush for Windows (#1817)
Browse files Browse the repository at this point in the history
The PURGE_RXABORT flag causes the ReadFileEx to be cancelled; on
cancellation, the ReadIOCompletion method is called with a non-zero
errorCode.

BREAKING CHANGE: flush behavior on windows no longer cancels inflight reads
  • Loading branch information
krutkay authored and reconbot committed May 2, 2019
1 parent ec87f83 commit 1daa919
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/bindings/src/serialport_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ void EIO_AfterList(uv_work_t* req) {
void EIO_Flush(uv_work_t* req) {
VoidBaton* data = static_cast<VoidBaton*>(req->data);

DWORD purge_all = PURGE_RXABORT | PURGE_RXCLEAR | PURGE_TXABORT | PURGE_TXCLEAR;
DWORD purge_all = PURGE_RXCLEAR | PURGE_TXABORT | PURGE_TXCLEAR;
if (!PurgeComm(int2handle(data->fd), purge_all)) {
ErrorCodeToString("Flushing connection (PurgeComm)", GetLastError(), data->errorString);
return;
Expand Down

0 comments on commit 1daa919

Please sign in to comment.