Using StreamSocketListener in the background with SocketActivityTrigger
问题 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