mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-16 11:21:18 +03:00
Merge pull request #70 from johannrichard/ethernet-close_wait
EthernetClient: recycle sockets in CLOSE_WAIT status
This commit is contained in:
@ -41,7 +41,7 @@ int EthernetClient::connect(IPAddress ip, uint16_t port) {
|
|||||||
|
|
||||||
for (int i = 0; i < MAX_SOCK_NUM; i++) {
|
for (int i = 0; i < MAX_SOCK_NUM; i++) {
|
||||||
uint8_t s = W5100.readSnSR(i);
|
uint8_t s = W5100.readSnSR(i);
|
||||||
if (s == SnSR::CLOSED || s == SnSR::FIN_WAIT) {
|
if (s == SnSR::CLOSED || s == SnSR::FIN_WAIT || s == SnSR::CLOSE_WAIT) {
|
||||||
_sock = i;
|
_sock = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user