ping code
Can anyone give me the easy code of ping command can I need it to see whether a machine is up or down in my code, I've found loads of ping code but all of them are very large and complex I need a simple one that can do the task.
Please Help, Regards, Imran |
or is there any library or function in C that can do the task of ping then please let me know.
thank you. regards, Imran |
The simplest ping program you're likely ever to find is at
http://www.unpbook.com/src.html Hope this helps. |
is there any library/systemcall that I can use to accomplish a ping ?
|
Why don't you look at the Linux source for the ping command? Basically, it is a very simple ICMP echo request/echo response.
|
I've looked at it its a bit kind of complex code so I was thinking that instead of copying that whole code in my program there might be a library available for that.
|
Pining a system via a network connection is not a simple task this is why the examples you are seeing are complicated.
As far as I know there is no system library that can accomplish this ( it is worth noting that there very well might be one on some exotic system) You can of course always write your own library. or just use the system function but its not recommended. |
ok thanks guys I'll use the existing code in my project.
thank you all |
To avoid trouble, make sure that you comply with the license terms accompanying any code you borrow.
Just a thought. |
right, thanks
|
All times are GMT -5. The time now is 07:03 AM. |