Problems connecting to internet via GPRS

  • Thread starter Roman Mellenberger
  • Start date
R

Roman Mellenberger

Our application is running on windows mobile 2005 on a Symbol MC70
with .net compact framework 2.0 SP2. Since a few days I have strange
troubles connecting to the internet via GPRS:

- If I connect manually to GPRS and then start the application
everything runs just fine
- If the application forces the connection itself (for example via web
request) GPRS connection will be established but all further request
from the app fail. If i go to the Internet explorer application,
leaving my application running and request the same URL there is also
no problem.

(Connecting via ActiveSync runs fine at all)

Here is the code i am using to force the connection in the app:

// Try to get answer
try
{

WebRequest request = WebRequest.Create(uri); //URI =
http://xx.xxx.xxx.xx/test (xx is an official IP address)
request.Timeout = 8000;
HttpWebResponse response =
(HttpWebResponse)request.GetResponse();
if (response.StatusCode == HttpStatusCode.OK)
{
// Return result
return 1;
}
else
{
CUtil.Log("CCommWatcher.HomeConnectCheck", "6",
string.Format("Could not connect to home server URI:{0} ",
uri.ToString()), CUtil.logLevel.information);
return 0;
}
}
catch (Exception ex)
{
CUtil.Log("CCommWatcher.HomeConnectCheck", "7",
string.Format("Could not connect to home server URI:{0} Exception{1}",
uri.ToString(), ex.ToString()), CUtil.logLevel.information);
return 0;
}

Here is the error message I get:
System.Net.WebException: Es kann keine Fehlermeldung angezeigt werden,
da die optionale Ressource der Assembly, die die Fehlermeldung
enthält, nicht gefunden wurde.__bei
System.Net.HttpWebRequest.finishGetResponse()__bei
System.Net.HttpWebRequest.GetResponse()__bei
InfoResearchBern.LTT.Comm.CCommWatcher.HomeConnectCheck()__bei
InfoResearchBern.LTT.Comm.CCommWatcher.HomeConnection()__bei
InfoResearchBern.LTT.Comm.CCommWatcher.CheckStatusAll()__bei
InfoResearchBern.LTT.Comm.CCommWatcher.CommunicationThread()__

Is there any suggest?

Best regards
Roman
 
C

Christian Resma Helle

What does:

Es kann keine Fehlermeldung angezeigt werden,
da die optionale Ressource der Assembly, die die Fehlermeldung
enthält, nicht gefunden wurde.__bei

Translate to?

--
Regards,
Christian Resma Helle
http://christian-helle.blogspot.com


Our application is running on windows mobile 2005 on a Symbol MC70
with .net compact framework 2.0 SP2. Since a few days I have strange
troubles connecting to the internet via GPRS:

- If I connect manually to GPRS and then start the application
everything runs just fine
- If the application forces the connection itself (for example via web
request) GPRS connection will be established but all further request
from the app fail. If i go to the Internet explorer application,
leaving my application running and request the same URL there is also
no problem.

(Connecting via ActiveSync runs fine at all)

Here is the code i am using to force the connection in the app:

// Try to get answer
try
{

WebRequest request = WebRequest.Create(uri); //URI =
http://xx.xxx.xxx.xx/test (xx is an official IP address)
request.Timeout = 8000;
HttpWebResponse response =
(HttpWebResponse)request.GetResponse();
if (response.StatusCode == HttpStatusCode.OK)
{
// Return result
return 1;
}
else
{
CUtil.Log("CCommWatcher.HomeConnectCheck", "6",
string.Format("Could not connect to home server URI:{0} ",
uri.ToString()), CUtil.logLevel.information);
return 0;
}
}
catch (Exception ex)
{
CUtil.Log("CCommWatcher.HomeConnectCheck", "7",
string.Format("Could not connect to home server URI:{0} Exception{1}",
uri.ToString(), ex.ToString()), CUtil.logLevel.information);
return 0;
}

Here is the error message I get:
System.Net.WebException: Es kann keine Fehlermeldung angezeigt werden,
da die optionale Ressource der Assembly, die die Fehlermeldung
enthält, nicht gefunden wurde.__bei
System.Net.HttpWebRequest.finishGetResponse()__bei
System.Net.HttpWebRequest.GetResponse()__bei
InfoResearchBern.LTT.Comm.CCommWatcher.HomeConnectCheck()__bei
InfoResearchBern.LTT.Comm.CCommWatcher.HomeConnection()__bei
InfoResearchBern.LTT.Comm.CCommWatcher.CheckStatusAll()__bei
InfoResearchBern.LTT.Comm.CCommWatcher.CommunicationThread()__

Is there any suggest?

Best regards
Roman
 
N

Neil Cowburn

The error message is basically saying that it can't find System.SR.dll so
there's no error message. It would be useful if the OP included the
ErrorCode associated with the WebException.

--Neil

--
----------------------------------------
Neil Cowburn
Principal Partner
OpenNETCF Consulting, LLC.

Managed Code in the Embedded World

http://www.opennetcf.com/
http://www.smartdeviceframework.com/
----------------------------------------
 
R

Roman Mellenberger

Maybe I have found the error. If I close the response object
(finally{response.Close()} it seems to work much bether but not in
every case. This wonders me because the response object is not
IDisposable and the handle is gone after leaving the method. Is this
documented somewhere that a non closed response object blocks the
network transfer of a whole application?
I don't use the stream it's just to be sure if the uri exists and
there is an answer. Maybe anyone knows a better way to check this...?

Thanks
Roman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top