locked
Socket behaviour when suspending app

    Question

  • Hi,

    I am currently working on an universal windows app.

    It is some form of game that requires a network connection, I am using a MessageWebSocket for this.

    I was under the impression that if my app becomes suspended It will no longer receive messages from the network.

    However if I explicitly suspend my app from visual studio, the MessageWebSocket MessageReceived event is still fired. It handles it by caling runAsync on the dispatcher which is of course not executed until the app is resumed but after resuming it the app is ain a state as if it received all network messages.

    Is this a side effect of the visual studio debugging? Or is it intended behaviour?

    Sunday, July 6, 2014 12:24 PM

All replies

  • Hi,

    Would you register a background task in your app. If you register it, the MessageReceived event is still fired when you suspend your app. If not, please upload a sample to OneDrive  and share some steps in the forum which can reproduce the problem.

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

    Monday, July 7, 2014 3:28 AM
  • I am not sure you understood my question correctly (or I misinterpreted your answer.)

    My problem is NOT that the message received does not fire.

    My "messagereceived" is firing despite the app being suspended when I debug with visual studio.

    Is this intended? Can I count on it working on an end user device the same way? Or is it only firing because it is a Visual studio debug session?

    P.S. no my app has no background task is not a lockscreen app (and should not be) or anything similar.
    • Edited by Qowy Tuesday, July 8, 2014 5:59 PM added ps
    Tuesday, July 8, 2014 5:58 PM
  • Hi,

    Would you mind sharing a reproduce sample to OneDrive so that we can test it.

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

    Friday, July 11, 2014 8:27 AM