How to establish a GPRS connection on .NET Compact Framework?

0 votes
asked Sep 14, 2010 by Rebex KB (8,240 points)
edited Aug 25, 2012

Establishing an FTP/SFTP/HTTP/etc. connection does not force the Windows Mobile OS to start a GPRS connection (when no connection of any type exists). Is there a way how to persuade Rebex components to connect via GPRS?

1 Answer

0 votes
answered Sep 15, 2010 by Rebex KB (8,240 points)
edited Jun 1 by Lukas Pokorny
Best answer

No. Rebex components focus on network protocols, not on connection managment.

To connect using a dial up connection from .NET CF on PocketPC, you can use Connection Manager functions such as ConnMgrEnumDestinations, ConnMgrEstablishConnection and ConnMgrReleaseConnection. Check out MSDN connection manager page for details. There are no classes available for this in .NET CF, but it can be done quite easily using P/Invoke if you have some experience with this. The following blog post covers this in detail and also contains C# source code.

Another solution is using the Smart Device Framework by that contains a wrapper class for the Connection Manager. It is free for any commercial or noncommercial purpose up to the version 1.4. It also includes the source code, so you might either use it as is or as a reference for your own implementation if you prefer.

commented May 31 by Ray007 (100 points)
According to the "NETCF's HttpWebRequest automatically sets up a GPRS connection for web requests/web services when a wired/wi-fi connection is not available."

When switching to use the REBEX HTTPS library, we found that the Rebex.Net.HttpRequest class does not automatically set up the GPRS connection. Is this correct and expected behaviour still?

We are plugging into the .Net WebRequest factory as shown at

Do you have a recommended method to automatically establish the GPRS connection?
commented Jun 1 by Lukas Pokorny (92,750 points)
Based on feedback for other Rebex libraries, we decided not to establish a connection automatically in Rebex HTTPS. We plan to eventually introduce a simple connection manager API to make it possible to establish a connection when needed. When this is ready, we'll add an option to Rebex HTTPS to emulate .NET CF's HttpWebRequest auto-connect behavior. Until then, the recommended method is to use the third-party library or code linked in the answer above to establish a connection when needed.