1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-30 19:52:13 +01:00

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().
This commit is contained in:
David A. Mellis 2010-09-16 00:59:12 +00:00
parent bf88db8484
commit 76641d1a87

View File

@ -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;