Websockets in a Windows 10 UWP background task
Is there a way to listen for web memory messages in a background job? I tried using ControlChannelTrigger
on Windows 10 and doesn't seem to work after closing the app (it works when the app is running). I noticed that the registered task is not being saved. Whenever I run the application, it cannot find it in the collection BackgroundTaskRegistration
. I noticed that when I use SocketActivityTrigger
, the task remains, but I have no idea if it can be used SocketActivityTrigger
with MessageWebSocket
. I also tried to use SocketActivityTrigger
with a class StreamSocket
, but also don't know how to connect to the endpoint "wss://"
.
I followed this example: https://code.msdn.microsoft.com/windowsapps/ControlChannelTrigger-91f6bed8
I used to use WNS background jobs, but now I want to get rid of my service and listen directly in the background job.
source to share
Would have commented if I could:
Not very familiar with Out of Process background tasks, but take a look at some examples .
C Tasks/
shows examples of how a background task can be implemented, and c BackgroundTask
shows a sample UI-based application. It seems that you can register for events and use them to communicate between them.
source to share