I wrote a very basic HTTP-based server program that runs in the background on my computer to allow me to automate various tasks from my Android (via HTTP requests in Tasker). All this works fine (banning this problem ), except that after more than 30 minutes of inactivity, the application finishes falling asleep as if it were being shunted from memory and takes about a minute or so to wake up when it receives an HTTP request or when I am trying to restore a window and interact with the user interface.
I use System.Net.HttpListenerto implement the server (using asynchronous calls BeginListen). How should I keep it on my toes?
source
share