ESP8266WiFi problem with client.connected ()

I have a problem with the ESP8266WiFi library. client connected () remains true, if the connection to the server is broken without the server has closed (like a power failure on the server). Is it a bug? How do I know if the client-side connection to the server is active?

if(!client.connected())
{
client = server.available();
return;
}
else
{
digitalWrite(LED_BUILTIN, LOW);
delay(50);
digitalWrite(LED_BUILTIN, HIGH);
delay(50);
}

Thanks for your valuable help.

Manovele:
Is it a bug?

Nope, just TCP.

How do you think I can fix it?

Try sending data to the server, and if it doesn't work within a certain period of time, timeout, and close the client manually.