uint32_t t0 = millis();
while (!cl.available()) {
if (millis() - t0 > time_out)
return (false); // timed out before seeing \n
delay(10);
}
int c = cl.read();
This works ok but I must always wait for the timeout to know when connection is finished.
So my question is: Is there a way to know immediately when a connection has been closed by the remote side?
Thank you.