Detect internet reachable

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ke Tao

    #1

    Detect internet reachable

    HI All,

    Is there anybody have an idea of how to detect internet is reachable ?
    At present , I'm using ping to detect internet is reachable , but it's
    maybe a bad idea , some firewall of router may block ping requesting.

    Best Regards,
    Ke Tao

  • Keith Thompson

    #2
    Re: Detect internet reachable

    Ke Tao <kotao78@gmail. comwrites:
    Is there anybody have an idea of how to detect internet is reachable ?
    At present , I'm using ping to detect internet is reachable , but it's
    maybe a bad idea , some firewall of router may block ping requesting.
    Standard C has no network support. You'll need to ask in a form that
    deals with your system. See question 19.40 in the comp.lang.c FAQ,
    <http://www.c-faq.com/>.

    --
    Keith Thompson (The_Other_Keit h) kst-u@mib.org <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

    Comment

    • Bill Reid

      #3
      Re: Detect internet reachable


      Keith Thompson <kst-u@mib.orgwrote in message
      news:lnlkdextw3 .fsf@nuthaus.mi b.org...
      Ke Tao <kotao78@gmail. comwrites:
      Is there anybody have an idea of how to detect internet is reachable ?
      At present , I'm using ping to detect internet is reachable , but it's
      maybe a bad idea , some firewall of router may block ping requesting.
      >
      Standard C has no network support. You'll need to ask in a form that
      deals with your system. See question 19.40 in the comp.lang.c FAQ,
      <http://www.c-faq.com/>.
      >
      Actually, it's worse than that, he probably should first try in some
      group that deals with Internet programming in general, and then he'll
      realize that using ping (or some equivalent activity, such as just
      trying to download a generally-available big commercial home page
      like http://www.yahoo.com, or better, pinging a list of DNS servers)
      is generally about as good as you're gonna be able to do.

      Usually, the only way to know if you're connected to the Internet
      is just to try to download something from the Internet, and a lot of
      purported API functions that promise to tell you your connection
      status at the SYSTEM level either don't work very well or at all, and/or,
      you guessed it, just try to connect to something on the Internet...

      However, you should definitely check them out if available, they
      MAY work for your purposes...it depends a lot on exactly what
      type of connection they are expecting, and in any case you are
      much more likely to be successful if you know PRECISELY the
      connection software/hardware that you are looking for ("default"
      connection software, dial-up vs. LAN, etc.)...

      ---
      William Ernest Reid



      Comment

      • Daniel Rudy

        #4
        Re: Detect internet reachable

        At about the time of 7/17/2007 10:19 PM, Bill Reid stated the following:
        Keith Thompson <kst-u@mib.orgwrote in message
        news:lnlkdextw3 .fsf@nuthaus.mi b.org...
        >Ke Tao <kotao78@gmail. comwrites:
        >
        >>Is there anybody have an idea of how to detect internet is reachable ?
        >>At present , I'm using ping to detect internet is reachable , but it's
        >>maybe a bad idea , some firewall of router may block ping requesting.
        >Standard C has no network support. You'll need to ask in a form that
        >deals with your system. See question 19.40 in the comp.lang.c FAQ,
        ><http://www.c-faq.com/>.
        >>
        Actually, it's worse than that, he probably should first try in some
        group that deals with Internet programming in general, and then he'll
        realize that using ping (or some equivalent activity, such as just
        trying to download a generally-available big commercial home page
        like http://www.yahoo.com, or better, pinging a list of DNS servers)
        is generally about as good as you're gonna be able to do.
        >
        Usually, the only way to know if you're connected to the Internet
        is just to try to download something from the Internet, and a lot of
        purported API functions that promise to tell you your connection
        status at the SYSTEM level either don't work very well or at all, and/or,
        you guessed it, just try to connect to something on the Internet...
        >
        However, you should definitely check them out if available, they
        MAY work for your purposes...it depends a lot on exactly what
        type of connection they are expecting, and in any case you are
        much more likely to be successful if you know PRECISELY the
        connection software/hardware that you are looking for ("default"
        connection software, dial-up vs. LAN, etc.)...
        >
        ---
        William Ernest Reid
        >
        >
        >
        Even though this is off topic, I usually do a dns lookup on something
        like www.yahoo.com.

        --
        Daniel Rudy

        Email address has been base64 encoded to reduce spam
        Decode email address using b64decode or uudecode -m

        Comment

        • SM Ryan

          #5
          Re: Detect internet reachable

          Ke Tao <kotao78@gmail. comwrote:
          # HI All,
          #
          # Is there anybody have an idea of how to detect internet is reachable ?
          # At present , I'm using ping to detect internet is reachable , but it's
          # maybe a bad idea , some firewall of router may block ping requesting.

          The internet is an amorphous collection of beellions
          and beellions diverse and oft noncooperative computers.
          The internet is also at times partionned with no notification.

          It makes no real sense to talk about the 'internet' is reachable.

          Instead concern yourself with whether your immediate network
          is reachable, which can be determined by a telephone or ethernet
          carrier detect, and then whether you can reach specific hosts out
          there in the great beyond.

          --
          SM Ryan http://www.rawbw.com/~wyrmwif/
          Raining down sulphur is like an endurance trial, man. Genocide is the
          most exhausting activity one can engage in. Next to soccer.

          Comment

          • Kenneth Brody

            #6
            Re: Detect internet reachable

            Daniel Rudy wrote:
            >
            At about the time of 7/17/2007 10:19 PM, Bill Reid stated the following:
            Keith Thompson <kst-u@mib.orgwrote in message
            news:lnlkdextw3 .fsf@nuthaus.mi b.org...
            Ke Tao <kotao78@gmail. comwrites:
            >Is there anybody have an idea of how to detect internet is reachable ?
            >At present , I'm using ping to detect internet is reachable , but it's
            >maybe a bad idea , some firewall of router may block ping requesting.
            [...]
            Even though this is off topic, I usually do a dns lookup on something
            like www.yahoo.com.
            <OT mode="even further" note="so why am I posting this?">
            And when the local router caches DNS and returns an IP, even though
            the other side is disconnected? Or when you can get to "the internet",
            but there is a problem between you and Yahoo's DNS server?

            One needs to define what "internet is reachable" means. And then one
            needs to ask somewhere this is topical.
            </OT>

            --
            +-------------------------+--------------------+-----------------------+
            | Kenneth J. Brody | www.hvcomputer.com | #include |
            | kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer .h|
            +-------------------------+--------------------+-----------------------+
            Don't e-mail me at: <mailto:ThisIsA SpamTrap@gmail. com>


            Comment

            Working...