Best route...

M

MobileBoy36

Hi group,



I should implement a class (VS 2005, .NET CF 2.0) that makes it possible to
choose the best adapter...

Let's take the following situation:



A pocket pc has a GPRS IP=162.11.128.116.

It 's WLAN adapter has (DHCP) IP=192.168.8.111.



Now I want to setup FTP communication with let's say 194.78.50.218.

What happens? The pocket pc sends the files over GPRS. Although the WLAN
adapter is active and has been assigned an IP.

This is not desirable...I want to take the best route, the cheapest way.

In my opinion there are 2 options to resolve this issue:



1. Programmatically close the GPRS connection. (But I don't find VB.NET code
to close the GPRS connection)

2. Changing the route table...How can this be achieved? (I'm missing the
MemoryCopy Lib "kernel32" on compact framework)



I prefer the first option.

Any other suggestions or code snippets that may help?



Best regards,

MobileBoy
 
P

Paul G. Tobey [eMVP]

I think that you should be able to configure the device so that the traffic
will go over WLAN. The problem is probably created because you've got WLAN
set up to connect to Work and GPRS to Internet. Since the IP you are trying
to talk to is *not* on the local subnet with the WLAN adapter, the system
assumes that it must be on the Internet, so it uses the fastest connection
it has to that set of addresses, GPRS. If you reconfigure the WLAN to
connect to Internet, also, since it is faster than GPRS, it will be chosen.

Paul T.
 
M

MobileBoy36

Thanks Paul for your reaction.
I tried your solution, but no success. The device still uses the GPRS way,
even if the LAN adapter is configured to connect to internet.
Is someone else struggling with this?
Has someone implemented the Getinterfaceinfo and
GetnumberOfInterfaces...API's?
Or maybe another possible solution? I 'simply' want a system that uses the
LAN connection (if available) in stead of GPRS.
No easy way to close the gprs connection programmatically?

best regards,
Mobileboy
 
P

Paul G. Tobey [eMVP]

If the system *wants* to use GPRS, closing it will be a complete waste of
time. Is the address you indicated in your original message available for
others to try? How are you deciding that GPRS is being used?

Paul T.
 
M

MobileBoy36

Hey Paul,

The address in my mail was fictitious, not available for others...
I have 2 ways indicating GPRS is being used:
1. The ftp logging on the server
2. My speakers are producing a terrible noice (like a buffalo flock) just
after clicking the Send button from my app...

I don't agree with the statement "closing GPRS will be a complete waste of
time"...
Customers don't want a program that sends a bolk of data over GPRS...So the
programmer has to engineer the application that the best available way is
chosen.
I don't now how to close the GPRS connection from VB.NET code.
The compact framework has been designed for mobile devices. So, in my
opinion, it's a great pity the GPRS functionality, and others like ftp comm,
is not directly (managed code) available in the .NET compact framework...
I'm still hoping for a solution. Your help is really appreciated.

best regards,
Mobile boy
 
P

Paul G. Tobey [eMVP]

2. My point is that, if that's the preferred method (if GPRS is the
lower-cost method, according to the routing table), then closing it won't do
*anything* but slow things down, as the connection manager will just reopen
the connection and use it anyway! So, closing it just causes the following
steps: close GPRS, open GPRS, send data over GPRS. What's the advantage?!

I've verified that, on my device, WiFi always has a lower cost shown in the
routing table, so, on my device, if both GPRS and WiFi were connected, both
are set to connect to "The Internet", etc., WiFi *will* be used in
preference to GPRS, whether GPRS is connected initially or not.

If it doesn't happen for you, ***you***, not Window Mobile or the Compact
Framework, are doing something wrong. Print out the routing table before
you attempt the FTP connection and I'll be shocked if the cost of the route
over WiFi isn't lower. If the cost of GPRS is lower, then you're not
telling us everything! In that case, you'll have to change the routing
table in order to force the network stack to use the higher costing WiFi,
rather than GPRS.

Paul T.

MobileBoy36 said:
Hey Paul,

The address in my mail was fictitious, not available for others...
I have 2 ways indicating GPRS is being used:
1. The ftp logging on the server
2. My speakers are producing a terrible noice (like a buffalo flock) just
after clicking the Send button from my app...

I don't agree with the statement "closing GPRS will be a complete waste of
time"...
Customers don't want a program that sends a bolk of data over GPRS...So
the programmer has to engineer the application that the best available way
is chosen.
I don't now how to close the GPRS connection from VB.NET code.
The compact framework has been designed for mobile devices. So, in my
opinion, it's a great pity the GPRS functionality, and others like ftp
comm, is not directly (managed code) available in the .NET compact
framework...
I'm still hoping for a solution. Your help is really appreciated.

best regards,
Mobile boy




Paul G. Tobey said:
If the system *wants* to use GPRS, closing it will be a complete waste of
time. Is the address you indicated in your original message available
for others to try? How are you deciding that GPRS is being used?

Paul T.

MobileBoy36 said:
Thanks Paul for your reaction.
I tried your solution, but no success. The device still uses the GPRS
way, even if the LAN adapter is configured to connect to internet.
Is someone else struggling with this?
Has someone implemented the Getinterfaceinfo and
GetnumberOfInterfaces...API's?
Or maybe another possible solution? I 'simply' want a system that uses
the LAN connection (if available) in stead of GPRS.
No easy way to close the gprs connection programmatically?

best regards,
Mobileboy

"Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com>
schreef in bericht I think that you should be able to configure the device so that the
traffic will go over WLAN. The problem is probably created because
you've got WLAN set up to connect to Work and GPRS to Internet. Since
the IP you are trying to talk to is *not* on the local subnet with the
WLAN adapter, the system assumes that it must be on the Internet, so it
uses the fastest connection it has to that set of addresses, GPRS. If
you reconfigure the WLAN to connect to Internet, also, since it is
faster than GPRS, it will be chosen.

Paul T.

Hi group,



I should implement a class (VS 2005, .NET CF 2.0) that makes it
possible to choose the best adapter...

Let's take the following situation:



A pocket pc has a GPRS IP=162.11.128.116.

It 's WLAN adapter has (DHCP) IP=192.168.8.111.



Now I want to setup FTP communication with let's say 194.78.50.218.

What happens? The pocket pc sends the files over GPRS. Although the
WLAN adapter is active and has been assigned an IP.

This is not desirable...I want to take the best route, the cheapest
way.

In my opinion there are 2 options to resolve this issue:



1. Programmatically close the GPRS connection. (But I don't find
VB.NET code to close the GPRS connection)

2. Changing the route table...How can this be achieved? (I'm missing
the MemoryCopy Lib "kernel32" on compact framework)



I prefer the first option.

Any other suggestions or code snippets that may help?



Best regards,

MobileBoy
 
M

MobileBoy36

Hi Paul,

I believe you on your word...thet you verified it and I appreciate the
helpfull information from the eMVP's.
I just try to get it working on my device.

I will briefly describe what I do:

Start->settings->connections->advanced -> button Select Networks
Under "Programs that automatically connect to the internet should connect
using", I select MY ISP
Under "Programs that automatically connect to a private network should
connect using", I also select MY ISP
I confirm with the ok button on the right top

Still under the advanced tab:
I select the button "Network card"

I select the appropriate adapter: In this example I selected Built-in
ethernet and give this adapter a fixed Ip (192.168.8.240,
255.255.255.0,192.168.8.1)
I confirm with ok

Under "My network card connects to:" I select "The Internet".
I confirm with ok.

When I (re)click the the button "Network card", the combobox is indicating
"Work" again, instead of "The Internet".
In my opinion this can cause the difference between the situation on your
device and mine...isn't it?

What makes this issue stranger for me:
1. The discussion on on microsoft.public.pocketpc.developer with topic "How
to turn on both GPRS and Wi-Fi connections at the same time??"

If it sould be easier for you and you are interesting, I'm able to set up a
VNC connection with you so you can see my device screen.
You can send an email to me if you consider it: Mobileboy36<add>gmail.com

best regards,
Mobile boy







"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> schreef in bericht news:[email protected]...
2. My point is that, if that's the preferred method (if GPRS is the
lower-cost method, according to the routing table), then closing it won't
do *anything* but slow things down, as the connection manager will just
reopen the connection and use it anyway! So, closing it just causes the
following steps: close GPRS, open GPRS, send data over GPRS. What's the
advantage?!

I've verified that, on my device, WiFi always has a lower cost shown in
the routing table, so, on my device, if both GPRS and WiFi were connected,
both are set to connect to "The Internet", etc., WiFi *will* be used in
preference to GPRS, whether GPRS is connected initially or not.

If it doesn't happen for you, ***you***, not Window Mobile or the Compact
Framework, are doing something wrong. Print out the routing table before
you attempt the FTP connection and I'll be shocked if the cost of the
route over WiFi isn't lower. If the cost of GPRS is lower, then you're
not telling us everything! In that case, you'll have to change the
routing table in order to force the network stack to use the higher
costing WiFi, rather than GPRS.

Paul T.

MobileBoy36 said:
Hey Paul,

The address in my mail was fictitious, not available for others...
I have 2 ways indicating GPRS is being used:
1. The ftp logging on the server
2. My speakers are producing a terrible noice (like a buffalo flock) just
after clicking the Send button from my app...

I don't agree with the statement "closing GPRS will be a complete waste
of time"...
Customers don't want a program that sends a bolk of data over GPRS...So
the programmer has to engineer the application that the best available
way is chosen.
I don't now how to close the GPRS connection from VB.NET code.
The compact framework has been designed for mobile devices. So, in my
opinion, it's a great pity the GPRS functionality, and others like ftp
comm, is not directly (managed code) available in the .NET compact
framework...
I'm still hoping for a solution. Your help is really appreciated.

best regards,
Mobile boy




Paul G. Tobey said:
If the system *wants* to use GPRS, closing it will be a complete waste
of time. Is the address you indicated in your original message
available for others to try? How are you deciding that GPRS is being
used?

Paul T.

Thanks Paul for your reaction.
I tried your solution, but no success. The device still uses the GPRS
way, even if the LAN adapter is configured to connect to internet.
Is someone else struggling with this?
Has someone implemented the Getinterfaceinfo and
GetnumberOfInterfaces...API's?
Or maybe another possible solution? I 'simply' want a system that uses
the LAN connection (if available) in stead of GPRS.
No easy way to close the gprs connection programmatically?

best regards,
Mobileboy

"Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT
com> schreef in bericht I think that you should be able to configure the device so that the
traffic will go over WLAN. The problem is probably created because
you've got WLAN set up to connect to Work and GPRS to Internet. Since
the IP you are trying to talk to is *not* on the local subnet with the
WLAN adapter, the system assumes that it must be on the Internet, so it
uses the fastest connection it has to that set of addresses, GPRS. If
you reconfigure the WLAN to connect to Internet, also, since it is
faster than GPRS, it will be chosen.

Paul T.

Hi group,



I should implement a class (VS 2005, .NET CF 2.0) that makes it
possible to choose the best adapter...

Let's take the following situation:



A pocket pc has a GPRS IP=162.11.128.116.

It 's WLAN adapter has (DHCP) IP=192.168.8.111.



Now I want to setup FTP communication with let's say 194.78.50.218.

What happens? The pocket pc sends the files over GPRS. Although the
WLAN adapter is active and has been assigned an IP.

This is not desirable...I want to take the best route, the cheapest
way.

In my opinion there are 2 options to resolve this issue:



1. Programmatically close the GPRS connection. (But I don't find
VB.NET code to close the GPRS connection)

2. Changing the route table...How can this be achieved? (I'm missing
the MemoryCopy Lib "kernel32" on compact framework)



I prefer the first option.

Any other suggestions or code snippets that may help?



Best regards,

MobileBoy
 

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