tomkuijsten / restup

Webserver for universal windows platform (UWP) apps
MIT License
114 stars 48 forks source link

Does it run in Background? #110

Closed Jaedson33 closed 7 years ago

Jaedson33 commented 7 years ago

How can I put the server to run in background?

Jark commented 7 years ago

The answer to this question is highly dependent on what device you are running the server on.

For Windows 10 IOT on the Raspberry PI you can utilise a background task.

For regular Windows 10 I think the window needs to stay active for it to keep on running, if the screen is locked the app is put it into sleep mode (see: https://github.com/tomkuijsten/restup/issues/55).

Hope this helps.

Jaedson33 commented 7 years ago

Well, I'm developing for Windows Mobile. So, can I run the server in background?

Jark commented 7 years ago

Last time I looked at doing that (about a year ago) that wasn't possible, since you're only allowed to run very limited tasks in the background that are triggered by something. Also you wouldn't want to run much in the background on a phone anyway since the battery would drain pretty fast with that + other apps running at the same time.

But if you do find a way to do it, please let us know and we can add it to the FAQ.

tomkuijsten commented 7 years ago

As far as I know, there is no way to always run a background task on mobile. You can set triggers from which background tasks are run (timer, OS events etc), but you will only have a limited amount of time while running the background task and it can be killed by the OS. There is enough MSDN documentation on this matter, I suggest to close the issue.

Jark commented 7 years ago

Agreed, closing.