What is your mean No internet connection ? Would you have more clear description ?
The module normal act as WiFi station, get it's IP address from associated network!
If the associated network did not connected to internet, the wifi module would not know !
The best way to solved this kind of issue is used heartbeat protocol between module and server!
We are using persistent TCP connections to the server, and we keep these connections alive as long as device is connected to the wifi AP. The problem is, if at some point internet service is lost, we are not able to detect internet outage. We keep sending messages over this socket assuming the connection is still alive. The send packet method return success even if the message never makes it to the server.
As I told! The WiFi module is L2 device,
It only could detect WiFi signal is lost or not, But IP layer and network stack stuff !
If internet service is lost during normal operation ! There are no good way to detect it !
Or you could wait the network stack detect it by protocol time out!
The best way is your application do some error checking and implement ACK protocol between application with server!