I've made an client app for OSX and now I have some troubles with OSX energy saving settings. So, in short, my problem is that when system goes to sleep mode, the network connection turns off.
It's mentioned in Apple support here
What happens when the Mac goes to sleep (not just into idle mode or display sleep)?
The Ethernet port turns off, if applicable (see note below)
Note: Portable computers have no network connectivity when in sleep mode, but can wake if the Energy Saver option "Wake for network access" is enabled. If you wish to use file sharing or don't want to interrupt your Internet connection, you should not manually put the computer to sleep, and you should drag the "Computer sleep" slider to Never.
So my client app cannot reach the service because of that. Regrettably, it is very unlikely, that I can just force end-users to turn off the "computer sleep" option.
I've tested my app working with "computer sleep" option turned on and off on long distances and it's quite obvious, that when this option is off, everything works fine, when it's on, requests stop working when system goes to sleep (with display sleep it works ok). The "Wake for network access" checkbox is also checked, but doesn't seem to help.
My question is, how can I allow my app to use network, when this option is turned on? There is a "Power Nap" option in energy settings, can I make my app support it somehow? If not, is there any programmatic solution, that would not require any action from end-user side?
Also, if this is impossible to implement, can I have an explanation why? Current apple documentation doesn't explain much about networking during sleep.
P.S. There's a similar question here on stackoverflow, that answers this question: How to programmatically prevent a Mac from going to sleep?
Looks like, I somehow missed it.