0

I'm including this library "ESP8266WiFi.h" at the top of my sketch. I can find documentation on WiFiServer.available(), but didn't find for WiFi.connected(), which is called in a server sketch after getting the client.

Clearly it's a test whether (once? I believe) the client is connected or not (and hasn't been explicitly closed in the server's side). It may seem obvious but some documented info would be helpful though.

1 Answer 1

1

You'll find it defined in WifiClient.h. The version I am using is, in WifiClient.cpp:

uint8_t WiFiClient::connected() {
  if (!_client)
    return 0;
  return _client->state() == ESTABLISHED || available();
}
2
  • Thank you. I think I will have to read the code thoroughly. Meanwhile I hope someone documents it... Commented Dec 3, 2017 at 7:58
  • Complain to the maintainers of the core. It's their responsibility. Commented Dec 3, 2017 at 9:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.