Esp8266 websocket server issue!

I faced an issue with websocket server let me explain it
now the client is connected to esp8266 websocket server then if wifi cut to client side suddenly so esp8266 server not detected
is there any solution?

Without the code this is just guess work.

I try that code from this link
https://www.martyncurrey.com/esp8266-and-the-arduino-ide-part-9-websockets/

Which is the exact code you are referring to ?
What is the output on the Serial monitor.

I have an example using the esp8266webserver that does something more or less the same in a different way.

Have you contacted the author of the tutorial with your issue ?

client side of websocket is android app so if the app closed so esp8266 can detect connection lost
but if the wifi turn off on android device then esp8266 not detect that connection lost

according to do some tests yesterday then when websocket client close android app then esp8266 websocket server detect that client closed connection :
response type as : 1 – WStype_DISCONNECTED
but if the wifi connection is turned off by client side then esp8266 not detect that the connection is lost

I need help to achieve this routine please
each 5 seconds I get number 9 from android app then I want to check if 5 seconds passed without getting number 9 then serial print "closed"

Then you will need to provide more accurate information.
Post the sketch (not the link) within code tag
post the output of the Serial monitor (also within code tag )
There is no pint for anyone to do guess work.