service application failing when pc sleeps

I have a service application that connects to a mail server, downloads some emails and writes some data from the messages to a file.

But it seems to do nothing when the computer goes to sleep. Here are my questions:

  1. Is this supposed to happen?
  2. Shouldn’t the service application wake the computer up automatically since it is doing some network activities? (As far as I know, the mac does this.)
  3. Is there a way for my app to tell the computer to not go to sleep?

Thank you in advance! :slight_smile:

The simplest solution would be to configure the computer not to sleep. If you don’t control the computer then the links below may provide the information needed to programmatically control sleep and wake functions in Windows.