Map URL to network card

P

Peter Morris

I think maybe this is what I should be trying to do instead. What I
actually want to do is to ensure that any requests for MyServer.com always
go through the PPC's LAN network card regardless of whether that card is
configured to connect to Work or Internet.

Can the connection manager do this? If so then some help would be
appreciated as I cannot find an example.



Thanks

Pete
 
P

Peter Foot [MVP]

You can't specify the connection to use, only the target network. However if
your network card is connected it should take priority over any other
connection means (GPRS etc) so if you configure it to connect to Internet it
should be used without needing to setup exceptions. Another thing you can
add to your code is a check to see if the network card is connected (Use
Microsoft.WindowsMobile.Status.SystemState properties) and make sure you are
only connecting if you have an active network connection
(ConnectionsNetworkCount versus ConnectionsCellularCount). I'm assuming your
network card is a wired network card and is only connected when the device
is docked?

Peter
 
P

Peter Morris

Hi Peter
You can't specify the connection to use, only the target network. However
if your network card is connected it should take priority over any other
connection means (GPRS etc) so if you configure it to connect to Internet
it should be used without needing to setup exceptions.

Do you know how I can check whether it is configured to connect to Work or
Internet? Also, what happens if it is the only available network (which it
will be) and it is configured to connect to "Work", would that make Internet
addresses inaccessible?


Another thing you can add to your code is a check to see if the network
card is connected (Use Microsoft.WindowsMobile.Status.SystemState
properties) and make sure you are only connecting if you have an active
network connection

I checked that by obtaining the current IP address and ensuring it is not
127.0.0.1

I'm assuming your network card is a wired network card and is only
connected when the device is docked?

That is correct. In fact my PPCs done even have SIM cards so the cradle
dock is the only form of network connection I have. I just want to ensure
that whenever I request a URL it will use that network.



Thanks, I appreciate your help!


Pete
 
P

Peter Foot [MVP]

Its buried in one of the Connections settings screens. What you could try
doing though is use connection manager to try and connect to the internet
guid, if it fails then pass the work guid. One of the two operations will
succeed if the network card is connected and you can then make your request.

Peter
 
P

Peter Morris

Its buried in one of the Connections settings screens. What you could try
doing though is use connection manager to try and connect to the internet
guid, if it fails then pass the work guid.

Oh yes, what a good idea, I hadn't thought of that! :)

I suppose it would be best to add the exception first so that the PPC tries
to connect via Work, and only if this fails then try to connect via
Internet. Otherwise if the network card is specified to connect to Work and
I try connecting via Internet it will show the GPRS dialler. If I first
check that the PPC has an IP address then I know that the operation should
succeed.

I'm very relieved that there is someone with your level of knowledge on this
subject that is willing to help. I appreciate it more than I can express,
thanks very much (again) for your help!


By the way, do you call Web services at all from any of your PPC apps? Some
of the PPCs that were able to connect to the WS were throwing an exception
"Unable to read data from the transport connection", do you have any ideas
what might have caused this? It sounds as though the client does not
understand the response from the server or something? The server is .NET
1.1 and the client is CF .NET 2.


Pete
 
P

Peter Morris

Just a quick question, what CM XML would I use to remove an exception?


Cheers

Pete
 

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