Skip to content

Commit

Permalink
Revert TCP checks for recovery (closes #711)
Browse files Browse the repository at this point in the history
Requires more tests on Windows with serial communications...
Related to db1cbc5 and 9b679b7.
  • Loading branch information
stephane committed Jul 17, 2024
1 parent dbb0766 commit 9fb0283
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/modbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ int _modbus_receive_msg(modbus_t *ctx, uint8_t *msg, msg_type_t msg_type)
#ifdef _WIN32
wsa_err = WSAGetLastError();
if ((ctx->error_recovery & MODBUS_ERROR_RECOVERY_LINK) &&
(ctx->backend->backend_type == _MODBUS_BACKEND_TYPE_TCP) &&
(wsa_err == WSAENOTCONN || wsa_err == WSAENETRESET ||
wsa_err == WSAENOTSOCK || wsa_err == WSAESHUTDOWN ||
wsa_err == WSAECONNABORTED || wsa_err == WSAETIMEDOUT ||
Expand All @@ -459,7 +458,6 @@ int _modbus_receive_msg(modbus_t *ctx, uint8_t *msg, msg_type_t msg_type)
}
#else
if ((ctx->error_recovery & MODBUS_ERROR_RECOVERY_LINK) &&
(ctx->backend->backend_type == _MODBUS_BACKEND_TYPE_TCP) &&
(errno == ECONNRESET || errno == ECONNREFUSED || errno == EBADF)) {
int saved_errno = errno;
modbus_close(ctx);
Expand Down

0 comments on commit 9fb0283

Please sign in to comment.