Skip to content

Commit 2a48aa5

Browse files
committed
Merge pull request #70 from johannrichard/ethernet-close_wait
EthernetClient: recycle sockets in CLOSE_WAIT status
2 parents 64f8f0a + 47c46c4 commit 2a48aa5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/Ethernet/EthernetClient.cpp

+1-1
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)