S
Sergey Shcherbakov
Hello, everybody.
I am experiencing the following problem.
Environment: Visual Studio 2005, .NET CF2 SP2, Windows Mobile 5.0,
Fujitsu-Siemens LOOX n560.
I can not get any response using HttpWebRequest on PDA if the locally
running server is requested AND PDA is not connected to any LAN.
Request to the locally running server (server running on PDA)
HttpWebRequest req = (HttpWebRequest)
WebRequest.Create("http://localhost/");
// or "http://127.0.0.1/"
req.GetResponse();
fails with WebException with message "Can not establish connection to
network" only in case when there is no available network connection (for
instance WLAN is down and device is not in cradle). As soon as a network
connection is established the same call to GetResponse() works.
Pocket IE shows response from the local server without any problems
independently from the state of the device network connection.
Moreover, when there is no locally running server at all, a call to
HttpWebResponse.GetResponse():
- IF the network connection is present and available on PDA,
throws WebException "Can not establish connection to the remote server"
The InnerException != null and contains socket error code 10061.
- IF the network connection IS NOT available on PDA,
throws WebException "Can not establish connection to network"
InnerException == null
(StackTrace in both cases shows error in HttpWebRequest.finishGetResponse()
method)
Thus, two different errors.
I can run the same binary code on a desktop PC. In this case in both
situations the generated errors are the same: "Can not establish connection
to remote server".
Should these two errors be the same in case of connection attempt to the
local address?
What causes the second error to be different and is it possible to fix this?
This issue affects client SOAP calls using SoapHttpClientProtocol too. It is
not possible to call a locally running web service when there is no network
connection.
Is this a .NET CF2 bug?
Please help me!
I am experiencing the following problem.
Environment: Visual Studio 2005, .NET CF2 SP2, Windows Mobile 5.0,
Fujitsu-Siemens LOOX n560.
I can not get any response using HttpWebRequest on PDA if the locally
running server is requested AND PDA is not connected to any LAN.
Request to the locally running server (server running on PDA)
HttpWebRequest req = (HttpWebRequest)
WebRequest.Create("http://localhost/");
// or "http://127.0.0.1/"
req.GetResponse();
fails with WebException with message "Can not establish connection to
network" only in case when there is no available network connection (for
instance WLAN is down and device is not in cradle). As soon as a network
connection is established the same call to GetResponse() works.
Pocket IE shows response from the local server without any problems
independently from the state of the device network connection.
Moreover, when there is no locally running server at all, a call to
HttpWebResponse.GetResponse():
- IF the network connection is present and available on PDA,
throws WebException "Can not establish connection to the remote server"
The InnerException != null and contains socket error code 10061.
- IF the network connection IS NOT available on PDA,
throws WebException "Can not establish connection to network"
InnerException == null
(StackTrace in both cases shows error in HttpWebRequest.finishGetResponse()
method)
Thus, two different errors.
I can run the same binary code on a desktop PC. In this case in both
situations the generated errors are the same: "Can not establish connection
to remote server".
Should these two errors be the same in case of connection attempt to the
local address?
What causes the second error to be different and is it possible to fix this?
This issue affects client SOAP calls using SoapHttpClientProtocol too. It is
not possible to call a locally running web service when there is no network
connection.
Is this a .NET CF2 bug?
Please help me!