diff --git a/src/comm/tcp_socket.cpp b/src/comm/tcp_socket.cpp index 1b6eb1a6..8803664a 100644 --- a/src/comm/tcp_socket.cpp +++ b/src/comm/tcp_socket.cpp @@ -188,7 +188,7 @@ bool TCPSocket::read(uint8_t* buf, const size_t buf_len, size_t& read) } else if (res < 0) { - if (errno != EAGAIN && errno != EWOULDBLOCK) + if (!(errno == EAGAIN || errno == EWOULDBLOCK)) { // any permanent error should be detected early state_ = SocketState::Disconnected;