Search code examples
c#windows-mobilecompact-frameworkwindows-mobile-6

Windows Mobile Wifi Networking After Wake Up From Sleep


I am developing a windows mobile application in c# that makes calls to a web service on a separate thread to the UI. This thread runs every few minutes triggered by a timer.

My problem is that if the hand held device goes to sleep, when it wakes up the OS seems to unload the networking and then restart the networking a second or so later.

The result of this more often than not is my application crashes.

Has anyone experienced a similar scenario?

Has anybody had to code around this problem?

Any help or comments would be gratefully received.

Thanks


Solution

  • It sounds like you should add some exception handling on your thread.

    Surround your networking code with a try catch block and retry the operation later:

    try {
        // your code 
    }
    catch (Exception ex)
    {
        // add some logging
    }