mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-06 01:08:25 +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:
parent
bf88db8484
commit
76641d1a87
@ -55,7 +55,8 @@ Client Server::available()
|
|||||||
for (int sock = 0; sock < MAX_SOCK_NUM; sock++) {
|
for (int sock = 0; sock < MAX_SOCK_NUM; sock++) {
|
||||||
Client client(sock);
|
Client client(sock);
|
||||||
if (EthernetClass::_server_port[sock] == _port &&
|
if (EthernetClass::_server_port[sock] == _port &&
|
||||||
client.status() == SnSR::ESTABLISHED) {
|
(client.status() == SnSR::ESTABLISHED ||
|
||||||
|
client.status() == SnSR::CLOSE_WAIT)) {
|
||||||
if (client.available()) {
|
if (client.available()) {
|
||||||
// XXX: don't always pick the lowest numbered socket.
|
// XXX: don't always pick the lowest numbered socket.
|
||||||
return client;
|
return client;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user