I am not sure of how many folks have tried to do something like what I have crossed recently…
What if you have to manage to connect 2 hosts, one in your local network and other on a remote network?
Well.. it is kind of odd scenario but It can happen… You will have to use your Wifi to connect to your local host and GPRS to connect to remote host.
However there is a problem: when developing app it is thought that OS can manage both connections and address each connection to right network.
Unfortunately it is nothing like that!!!
I have crossed this issue and it cost me some sleep, but I figured it out…
Each connection (nic) has one metric assigned to it; lesser the metric bigger the priority. this metric is evaluated on nic’s speed – so you calculate something like craddle metric < wifi < GPRS.
What you see is that wifi will have a lesser metric and therefore a bigger priority; when you try to reach remote host it won’t since your wifi connection overrides your gprs.
This is Windows mobile 6 behavior and not expected to me…
Having this known is time to work on a solution… I am not the first facing this and will not the last, so let us bring a solution to next guy.
There is something like a routing table also on windows mobile. What we can manage to do is first of all check if our device has gprs connected. If so, then we must add an entry on routing table that tells that when trying to reach that “XXXX” address it should go on that specific nic and not by metric.
This may seem hard to do… some complex C# as you may think.. or not!
I have managed to manufacture a solution based on OpenNetCommunity library.
There are some things you should manage: your nics and your routes.
I do believe that it can be bet understood with an example.
I will leave you with my lab that exemplifies a solutions with OpenNet.
Lab: TestingWifiAndGPRSConnection
For this lab I hard coded mask Address and Ip Address, but you can have it on a file of settings or in a textBox, whatever….
Some details:
I had to configure Internet connection to GPRS and Local Connection to Ethernet; also had an exception relative to my service since it was http on local network.
Final detail was that I defined my IpFowarding as Route.Intermediate.
I don’t know if it was all needed but this was how I finally achieved my goal!
Be happy now!








Hi Ricardo, my question in english, i didn’t know if you understand spanish, but here my question
is possible detect the level of signal of gprs? I’ve a app with gprs connection, and when I’m trying to connect to 3g the device wait for many minutes because the low signal, after that the device show me a message that was impossible connect. If I could detect the level of signal i,I’ll decide connect to 3g or no.
Thanks for yo attention
Hi Alejandro.
I haven’t understood your question on first time.
Although I haven’t tried to measure GPRS signal I do believe this to be possible. Perhaps if you try Opennetcf libraries you may find something to help you.
Also a hint: check how are set your connections – you may have your network configuration as not allowing communication if not by work connection and trying to use gprs connection(I have no device here so terms may be incorrect but I think that when looking for configuration you will understand what I am saying).
Tell me if it helps you.
Hola Ricardo Figueiredo, no sabia si hablabas castellano, por lo que supuse que si por el Nombre, espero no haberme equivocado…
Queria pregutarte, es posible de alguna manera saber cual es el nivel de señal de la conexion GPRS?
Desde ya muchas Gracias
Hi Alejandro.
I understand a little bit of spanish.
The GPRS connection was working fine. I was a litle troubling to put it to work, as it worked fine with a single connection. The trouble was that I had to put 2 different networks to run. But signal was just fine.
Let me know if there is anything else I can do for you.