Skip to content

Commit 76641d1

Browse files
committed
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().
1 parent bf88db8 commit 76641d1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libraries/Ethernet/Server.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ Client Server::available()
5555
for (int sock = 0; sock < MAX_SOCK_NUM; sock++) {
5656
Client client(sock);
5757
if (EthernetClass::_server_port[sock] == _port &&
58-
client.status() == SnSR::ESTABLISHED) {
58+
(client.status() == SnSR::ESTABLISHED ||
59+
client.status() == SnSR::CLOSE_WAIT)) {
5960
if (client.available()) {
6061
// XXX: don't always pick the lowest numbered socket.
6162
return client;

0 commit comments

Comments
 (0)