![]() |
| | #1 |
| Registered User Join Date: Feb 2008 Location: Bangalore, India
Posts: 16
| ping an IP and get status i want to make a C program which can ping an IP and provide the status whether that device is available or not in the form of some integer value i.e for available give '1' and other for NULL |
| krishna is offline | |
| | #2 |
| and the hat of Jobseeking Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,693
| You mean like what the "ping" program does? |
| Salem is offline | |
| | #3 |
| C++ Witch Join Date: Oct 2003 Location: Singapore
Posts: 11,339
| Moved to Networking/Device Communication.
__________________ C + C++ Compiler: MinGW port of GCC Build + Version Control System: SCons + Bazaar Look up a C/C++ Reference and learn How To Ask Questions The Smart Way |
| laserlight is online now | |
| | #5 |
| Senior software engineer Join Date: Mar 2007 Location: Portland, OR
Posts: 5,768
| First thing to realize, is that just because a device does not respond to an ICMP "ping", does not mean that device is unavailable. It just might not be responding to ping, for many legitimate reasons.
__________________ "Congratulations on your purchase. To begin using your quantum computer, set the power switch to both off and on simultaneously." -- raftpeople@slashdot |
| brewbuck is offline | |
| | #6 | |
| Kernel hacker Join Date: Jul 2007 Location: Farncombe, Surrey, England
Posts: 15,686
| Quote:
-- Mats
__________________ Compilers can produce warnings - make the compiler programmers happy: Use them! Please don't PM me for help - and no, I don't do help over instant messengers. | |
| matsp is offline | |
| | #8 |
| Registered User Join Date: Sep 2008
Posts: 15
| ok. so how do you make a program that will ping an address, regardless if the results are positive or negative? |
| edomingox is offline | |
| | #9 |
| and the hat of Jobseeking Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,693
| Seriously, what are you trying to do? You "make" the program by reading the RFC, writing code to send out the right kind of message, then interpreting the responses (or lack of). If you don't know how to do that, then looking at an existing "ping.c" program might help. But the good ones (with a reasonable level of functionality) are not exactly small. Or if you just don't want to know about the code, just write a simple wrapper around the "ping" program which comes with your OS. |
| Salem is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|