WiFi Shield sending packets to avoid disconnection

Im new on this and I just got my wifi shield which I now know has some trouble staying connected to the network.

I´ve read that the way to make it stay connected is for it to send some "heartbeat" message.

I really don´t know how to do this. Could someone help?

I´m attaching my code.

Thanks

SimpleWebServerWiFi.ino (4.78 KB)