My application on the ChipworkX does a heartbeat via an http web request (SSL) to a server every 30 seconds just to let the server know it is still up and running. Every 5 minutes it checks if there is any data to be sent up to the server and sends it via http web request as well (rolled up in a JSON string). Everything seems to work well but the units seem to experience a problem after several hours where the web request fails. It actually fails getting the response. see code line below.
response = (HttpWebResponse)request.GetResponse();
This is from the stack trace I log when the error occurs.
A simple reboot fixes it and it goes along fine doing this again for a while. I was able to work around it by simple rebooting the unit if it fails for more than 15 minutes in a row. So it basically reboots itself 2-3 times a day. I have double and triple checked that I close and dispose of everything during successful and unsuccessful connections.
Is there a problem with doing a web request like this so often? It is somewhat critical to the operation of the unit. Is there something that needs to be cleared every once in a while?