How to test if network is available?

obrienj

Member
Licensed User
How can I test if I have access to a network be it with my host, the Internet, or a wireless access point without blocking?

From my laptop, I simply use "ping" and look at the result.

Is there such a construct in B4PPC?

Regards,
Jim
 
Last edited:

obrienj

Member
Licensed User
agraham,

Thanks.

I'm off to take a detailed look.

Will I need both libraries discussed in the description?

Regards,
Jim
 

agraham

Expert
Licensed User
Longtime User
Will I need both libraries discussed in the description?
Yes. Run the demo, it shows all the adaptor info available. I am not sure that if you can tell that the network is available right at this moment, but if the Gateway and IP address begin with (probably) 192 it should indicate that a network with a DHCP server was available at some time in the past!
 

obrienj

Member
Licensed User
agraham,

Thanks.

What I am most interested in is checking if I have a connection to my host system like "AreYouThere IP/URL port timeout". Since network.Connect blocks without a timeout ability, I need another way to do the check.

When I run the sample on my HTC Mogul, I see that if I am connected, only one adater shows an IP address and the others have 0.0.0.0. If I am not connected, the adapter that was connected isn't there and the remaining ones have no IP address.

Since the connection to the host when connected is an RDNIS (sp?) one using ActiveSync, I can use that info also.

Maybe this is a little C# experiment (library???),

Thanks for the nice little library.

Regards,
Jim
 
Top