Skip to content

Commit 349b294

Browse files
committed
Merge pull request #70 from johannrichard/ethernet-close_wait
EthernetClient: recycle sockets in CLOSE_WAIT status
2 parents 5182112 + d2d9e91 commit 349b294

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

EthernetClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ int EthernetClient::connect(IPAddress ip, uint16_t port) {
4141

4242
for (int i = 0; i < MAX_SOCK_NUM; i++) {
4343
uint8_t s = W5100.readSnSR(i);
44-
if (s == SnSR::CLOSED || s == SnSR::FIN_WAIT) {
44+
if (s == SnSR::CLOSED || s == SnSR::FIN_WAIT || s == SnSR::CLOSE_WAIT) {
4545
_sock = i;
4646
break;
4747
}

0 commit comments

Comments
 (0)