From 1daa9191a7e47c4146ae3394cb705a92d8f8d28b Mon Sep 17 00:00:00 2001 From: krutkay Date: Wed, 1 May 2019 21:57:58 -0400 Subject: [PATCH] fix: remove PURGE_RXABORT flag on flush for Windows (#1817) 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 --- packages/bindings/src/serialport_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bindings/src/serialport_win.cpp b/packages/bindings/src/serialport_win.cpp index bdce93ac9..c28f8c019 100644 --- a/packages/bindings/src/serialport_win.cpp +++ b/packages/bindings/src/serialport_win.cpp @@ -935,7 +935,7 @@ void EIO_AfterList(uv_work_t* req) { void EIO_Flush(uv_work_t* req) { VoidBaton* data = static_cast(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;