By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,719 Members | 1,875 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,719 IT Pros & Developers. It's quick & easy.

Detect internet reachable

P: n/a
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

Jul 18 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Ke Tao <ko*****@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_Keith) ks***@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"
Jul 18 '07 #2

P: n/a

Keith Thompson <ks***@mib.orgwrote in message
news:ln************@nuthaus.mib.org...
Ke Tao <ko*****@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

Jul 18 '07 #3

P: n/a
At about the time of 7/17/2007 10:19 PM, Bill Reid stated the following:
Keith Thompson <ks***@mib.orgwrote in message
news:ln************@nuthaus.mib.org...
>Ke Tao <ko*****@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
Jul 18 '07 #4

P: n/a
Ke Tao <ko*****@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.
Jul 18 '07 #5

P: n/a
Daniel Rudy wrote:
>
At about the time of 7/17/2007 10:19 PM, Bill Reid stated the following:
Keith Thompson <ks***@mib.orgwrote in message
news:ln************@nuthaus.mib.org...
Ke Tao <ko*****@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:Th*************@gmail.com>
Jul 19 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.