473,399 Members | 3,832 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,399 software developers and data experts.

Application to check the Internet status??


I tried checking internet status of my system by issuing ping to some
well known server like google.com. But, the problem is that ping is
not working if target address is not within the same network. I
actually started writing small application, which can tell the
internet status of the given system by using some standard network
Apis. It would be great if some one suggest me how to proceed for
this.

Thanx in advance,
Ravindra. Bhadramraju
Aug 5 '08 #1
5 2424
Ravindra.B wrote:
I tried checking internet status of my system by issuing ping to some
well known server like google.com. But, the problem is that ping is
not working if target address is not within the same network. I
actually started writing small application, which can tell the
internet status of the given system by using some standard network
Apis. It would be great if some one suggest me how to proceed for
this.
Try on a group for your system since any methods to do this will be
specific for your implementation and/or system. For ideas under Unix
type systems see comp.unix.programmer and see
comp.os.ms-windows.programmer.win32 for Windows machines. There is no
generic way to do this, nor in purely Standard C.

Aug 5 '08 #2
"Ravindra.B" <ra******************@gmail.comwrote:
I tried checking internet status of my system by issuing ping to some
well known server like google.com. But, the problem is that ping is
not working if target address is not within the same network.
No, the problem is that there is no reliable way to do what you want.
And no, I don't mean "no way using ISO C only"; I mean no reliable way
at all. For example, have you thought about what you'd do if your
firewall let you connect to most sites, but (for some, possibly
temporary reason) not to the one you intend to abuse for this purpose?

Richard
Aug 5 '08 #3
On 5 Aug 2008 at 12:46, Ravindra.B wrote:
I tried checking internet status of my system by issuing ping to some
well known server like google.com. But, the problem is that ping is
not working if target address is not within the same network. I
actually started writing small application, which can tell the
internet status of the given system by using some standard network
Apis. It would be great if some one suggest me how to proceed for
this.
I'm not completely sure what it is you want to do. It may just be a DNS
problem - otherwise you could try a traceroute and see how far your
packet gets before being dropped.

As for doing this in C, I can't think of a standard ping library - you
could download a ping program from the web and include the code in your
program, or just write it yourself using basic networking: you need to
send an ICMP echo request packet, and then receive (hopefully...) the
echo back.

If you need more information, describe the problem clearly!

Aug 5 '08 #4
On Aug 6, 3:10*am, Antoninus Twink <nos...@nospam.invalidwrote:
On *5 Aug 2008 at 12:46, Ravindra.B wrote:
I tried checking internet status of my system by issuing ping to some
well known server like google.com. But, the problem is that ping is
not working if target address is not within the same network. I
actually started writing small application, which can tell the
internet status of the given system by using some standard network
Apis. It would be great if some one suggest me how to proceed for
this.

I'm not completely sure what it is you want to do. It may just be a DNS
problem - otherwise you could try a traceroute and see how far your
packet gets before being dropped.

As for doing this in C, I can't think of a standard ping library - you
could download a ping program from the web and include the code in your
program, or just write it yourself using basic networking: you need to
send an ICMP echo request packet, and then receive (hopefully...) the
echo back.

If you need more information, describe the problem clearly!
Well, the requirement is something like this...a small api/function
which could tell if the internet connection is available or not and in
either case it should send a userfriendly message to the application.
To put it in a simple way, if the client application wants to check
every time the internet status of a given system before connecting to
the remote server how can it be achived by using standard Unix-network
Apis
Aug 6 '08 #5
Ravindra.B wrote:
On Aug 6, 3:10*am, Antoninus Twink <nos...@nospam.invalidwrote:
>On *5 Aug 2008 at 12:46, Ravindra.B wrote:
I tried checking internet status of my system by issuing ping to
some well known server like google.com. But, the problem is that
ping is not working if target address is not within the same
network. I actually started writing small application, which can
tell the internet status of the given system by using some standard
network Apis. It would be great if some one suggest me how to
proceed for this.

I'm not completely sure what it is you want to do. It may just be a
DNS problem - otherwise you could try a traceroute and see how far
your packet gets before being dropped.

As for doing this in C, I can't think of a standard ping library -
you could download a ping program from the web and include the code
in your program, or just write it yourself using basic networking:
you need to send an ICMP echo request packet, and then receive
(hopefully...) the echo back.

If you need more information, describe the problem clearly!

Well, the requirement is something like this...a small api/function
which could tell if the internet connection is available or not and in
either case it should send a userfriendly message to the application.
To put it in a simple way, if the client application wants to check
every time the internet status of a given system before connecting to
the remote server how can it be achived by using standard Unix-network
Apis
Please note that networking is not defined in any manner by the C
Standard and you will need to use system specific extensions to attempt
what you want. For that a group dealing with your system is a much
better place than here. If you program uses the POSIX APIs ask in
comp.unix.programmer, if it uses the Windows API ask in
comp.os.ms-windows.programmer.win32 or another suitable group.

<OT>
The usual method is try to connect and handle failure. This is a bit
like trying to read a byte and getting end-of-file or error in C.
</OT>

Aug 6 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Graeme Coutts | last post by:
Developed a web application which adopts a custom security model which displays a login page and requests a username/password combination. The username works in a mixed-mode of usernames matched with...
6
by: @win | last post by:
Hello, I'm creating a windows service with VB.net. (vs 2003) I want this service to connect (or check the status of the connection) to the internet via a ISDN modem connection (standard dailup)...
23
by: Gustaf | last post by:
I just read this article from today: http://webstandards.org/buzz/archive/2005_09.html I need some help understanding this sentense: The W3C recommends XHTML 1.1 should be served with the...
2
by: JoeBlack | last post by:
Hi all, I am new to web development and have been asked if the following is possible, I was hoping some people with more experience than me could confirm if this is possible and what...
3
by: Daniel Liberman | last post by:
Hi, everyone. That's my environment: - I have a pocket pc (iPAQ h4350) application developed with VSNET2003/C# that has a SQL Server CE Database, running. That's working fine. Obs: the pocket...
1
by: toori | last post by:
i am new to the JAVA...Any one help to make codes for this server client application program "Design and implement a server application which acts as an Internet bank, i.e. keeps track of bank...
1
by: CodeSeeker | last post by:
I have an application, which uses pop3 to read the messages from the mailbox, and it has been working fine for so many year. We recently have started changing this application to use java mail IMAP 4...
3
by: Sylvie | last post by:
My Windows Application has two forms, one form contains a grid (lets say Stock Listing), and the other is a form of one stock, contains some edit boxes for one stock's fields.. Is it possible to...
2
by: swethak | last post by:
Hi, I am getting the problem the problem with google map in Internet Explorer. This map worked fine in mozilla . When i opened the same map in Internet Explorer i am getting the error...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.