Skip to content

Commit

Permalink
Fixed sockindex left with non-default value when connection fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
nschurando committed Nov 16, 2021
1 parent 5cdcdbc commit 4519a30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/EthernetClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 4519a30

Please sign in to comment.