Reputation: 540
Our company wants to port its VoIP application to Universal Windows Platform.
I discovered new VoIP example for UWP https://github.com/Microsoft/Windows-universal-samples
I've checked previous ChatterBox examples - for WP8 and WP 8.1 (and did port own application to these platform).
I see that new VoIP example differs from previous ChatterBox example significantly.
Most of these changes are clear for me.
But I need advice.
New demo uses AppServiceConnection to tell VoipTasks component to run VoIP-related commands.
What is best way for reverse direction? How to dispatch events from VoipTasks/VoipBackend back to UI part of application?
Thank you :)
Upvotes: 0
Views: 1437
Reputation: 151
AppServiceConnection is indeed bi-directional. In terms of lifetime an app service can run as long as the client keeps the connection open. For example, in cases where the client is an app the user is currently looking at you can safely assume that the app service will stay running and respond to events until the user turns off the screen or heads to another app. When that happens Windows will usually come along and suspend the foreground app and terminate any app services it might have sponsored. When your app comes out of suspension it can simply reopen an app service connection to the app service and Windows will start it running again. In fact, I would recommend closing any open app service connections in your foreground app's suspension handler.
Here's the official app services sample that I wrote https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/AppServices and my Build session where I discuss app servies (about 25 minutes in) https://channel9.msdn.com/events/Build/2015/3-765. Feel free to reach me @aruntalkstech if you have more questions about app services.
Upvotes: 1
Reputation: 540
It seems AppServiceConnection is bidirectional. I can send events back via SendRequestAsync. I still worry about its lifetime a bit - but experiments will reveal the truth
Upvotes: 0