mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-26 02:47:17 +00:00
Return after encountering errors in windows write
The unix version breaks the while loop by returning on certain errors. On Windows, the errors were being contained because the while loop was never breaking. For example, pulling the USB cable out would raise “Access Denied” errors but the while loop would run forever and contain that error.
This commit is contained in:
parent
59f281f136
commit
6d2e4b5fa7
1 changed files with 2 additions and 0 deletions
|
|
@ -378,6 +378,7 @@ void EIO_Write(uv_work_t* req) {
|
|||
if(lastError != ERROR_IO_PENDING) {
|
||||
// Write operation error
|
||||
ErrorCodeToString("Writing to COM port (WriteFile)", lastError, data->errorString);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
// Write operation is asynchronous and is pending
|
||||
|
|
@ -390,6 +391,7 @@ void EIO_Write(uv_work_t* req) {
|
|||
// Write operation error
|
||||
DWORD lastError = GetLastError();
|
||||
ErrorCodeToString("Writing to COM port (GetOverlappedResult)", lastError, data->errorString);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
// Write operation completed asynchronously
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue