From 47c46c4f254cb073b08e6e0fcfdff8dea797a39a Mon Sep 17 00:00:00 2001 From: Johann Richard Date: Thu, 5 Apr 2012 22:13:49 +0200 Subject: [PATCH] Fix for CLOSE_WAIT Bug Fir for an EthernetClient bug, as per the following thread http://forum.freetronics.com/viewtopic.php?t=176 Kudos to mr-russ for finding a fix. --- libraries/Ethernet/EthernetClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Ethernet/EthernetClient.cpp b/libraries/Ethernet/EthernetClient.cpp index a77a62beb..9885efb78 100644 --- a/libraries/Ethernet/EthernetClient.cpp +++ b/libraries/Ethernet/EthernetClient.cpp @@ -41,7 +41,7 @@ int EthernetClient::connect(IPAddress ip, uint16_t port) { for (int i = 0; i < MAX_SOCK_NUM; 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; break; }