问题
In order to make a UWP App act like an HTTP server, restup does the job. But the problem is that it does not provide an HTTP server that works even after the app is closed.
In order to achieve this, a background task with SocketActivityTrigger has to be created and the socket ownership of StreamSocketListener has to be transferred to the socket broker so that the background task is triggered when a request comes (as explained here). And here is an example for an app that connects to a socket and keeps receiving messages even after the app is closed.
I tried to adapt this to make restup work in the background as well, but in vain!
Could someone help on this please?
来源:https://stackoverflow.com/questions/59716347/using-streamsocketlistener-in-the-background-with-socketactivitytrigger