473,386 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

Jul 18 '07 #1
5 2686
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

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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: David McCulloch | last post by:
QUESTION-1: How can I detect if Norton Internet Security is blocking pop-ups? QUESTION-2a: How could I know if a particular JavaScript function has been declared? QUESTION-2b: How could I...
2
by: Yurij Nykon | last post by:
Hi all. How can I detect the version of Flash-Plugin installed in Internet Explorer? In Netscape i can do this with following java script navigator.plugins.description But it doesn't works...
6
by: hb | last post by:
Hi, Would you please tell me how to detect if the client's browser is closed? I need such event to trigger a database modification. Thank you hb
3
by: sanjeeev | last post by:
I am loooking for the bet way to share files between Internet and Intranet application in real time, means as soon as an file is uploaded to the intranet application it should show up in the...
3
by: Dan Sikorsky | last post by:
I can send email using C# and SMTP, but keep closing the connection before the .eml file has left the Queue folder. The length of time the .eml file stays in the Queue folder is dependent on the...
10
by: Adam Honek | last post by:
Hi all, How would one test for internet connectivity in VB.NET instead of using the Win32 API methods? Thanks, Adam
0
by: Arthur | last post by:
Hi, I am trying to write a windows service in VC++.NET 2003, the task of this server is to detect the kind of internet connection and if there is a connection send some file and do something. ...
4
by: perspolis | last post by:
Hi all How can I find that user is connected to internet or not? thanks in advance
4
by: adalton | last post by:
I've been trying to figure out how to test for a valid internet connection. I am able to connect to a valid internet connection, but when it drops, or if it is not there when my program starts, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.