How to test if network is available?

Discussion in 'Questions (Windows Mobile)' started by obrienj, Jul 13, 2008.

  1. obrienj

    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: Jul 13, 2008
  2. agraham

    agraham Expert Licensed User

  3. obrienj

    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
     
  4. agraham

    agraham Expert Licensed User

    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!
     
  5. obrienj

    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
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice