From 76641d1a87116605b219e2778efe868cbc148e61 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Thu, 16 Sep 2010 00:59:12 +0000 Subject: [PATCH] Returning CLOSE_WAIT clients in Server::available(). (issue #345). Otherwise, we miss clients that connect, send data, and disconnect before we get around to calling available(). --- libraries/Ethernet/Server.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/Ethernet/Server.cpp b/libraries/Ethernet/Server.cpp index d229bf86a..4271741b9 100644 --- a/libraries/Ethernet/Server.cpp +++ b/libraries/Ethernet/Server.cpp @@ -55,7 +55,8 @@ Client Server::available() for (int sock = 0; sock < MAX_SOCK_NUM; sock++) { Client client(sock); if (EthernetClass::_server_port[sock] == _port && - client.status() == SnSR::ESTABLISHED) { + (client.status() == SnSR::ESTABLISHED || + client.status() == SnSR::CLOSE_WAIT)) { if (client.available()) { // XXX: don't always pick the lowest numbered socket. return client;