Arduino IDE documentation for WiFi.connected()
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-&gt;state() == ESTABLISHED || available();
}