diff --git a/src/EthernetClient.cpp b/src/EthernetClient.cpp index 5a20c748..0c1edb4c 100644 --- a/src/EthernetClient.cpp +++ b/src/EthernetClient.cpp @@ -60,7 +60,7 @@ int EthernetClient::connect(IPAddress ip, uint16_t port) uint8_t stat = Ethernet.socketStatus(_sockindex); if (stat == SnSR::ESTABLISHED) return 1; if (stat == SnSR::CLOSE_WAIT) return 1; - if (stat == SnSR::CLOSED) return 0; + if (stat == SnSR::CLOSED) { _sockindex = MAX_SOCK_NUM; return 0; } if (millis() - start > _timeout) break; delay(1); }