WebClient - Resource unavailable when using Bluetooth

I’m trying to download data using WebClient.DownloadStringAsync(). This works perfectly when using the watch emulator or a real watch connected to the Internet via Wifi. However when the same watch is connected via bluetooth and with Wifi turned off I always get the following error:

Resource temporarily unavailable at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionifNecessary()…

This error is raised almost immediately after calling DownloadStringAsync (and WebClient’s default timeout is 100 seconds) so it doesn’t seem to be a timeout issue. I can also navigate using Samsung’s Internet app on the watch when the error occurs.

What can be wrong here?

Can you provide the detailed error message? You can use the try-catch block and grab the error inside the catch block and print the error message. Please share the error message.

Hi. I could “fix” the issue by using a proxy in the web client when the watch is connected to the phone, this way:

        WebClient client = new WebClient();

        #if !DEBUG
        //throws silent error in the emulator, so only use proxy in Release mode
        if (ConnectionManager.CurrentConnection.Type == ConnectionType.Ethernet) {
            string proxyAddr = ConnectionManager.GetProxy(AddressFamily.IPv4);
            client.Proxy = new WebProxy(proxyAddr, true);

I’m not sure if this is the normal/recommended way of handling connections in this scenario, as this is not mentioned anywhere in the documentation. And this is surprising since the watch is supposed to be paired and connected to the phone most of the time.

However the above fix does not help when some view, as an Image, uses an URL to a remote resource. In that case the resource is not loaded as there is no way of setting the proxy. Am I missing something?