Results 1 to 1 of 1
I am trying to "ping" a remote host in my C++/Redhat Linux code to
check whether that host is connected or not.
if (0 == system("ping -w 2 192.168.0.2))
But, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 02-14-2006 #1Just Joined!
- Join Date
- Feb 2006
- Posts
- 4
Ping command doesn't work properly
I am trying to "ping" a remote host in my C++/Redhat Linux code to
check whether that host is connected or not.
if (0 == system("ping -w 2 192.168.0.2))
But, in both cases (connected/disconnected), system call returns 0. Can
someone please show what I am doing wrong? How to check the actual
result of the ping status using C++ on Redhat linux ?
Thanks in advance.


Reply With Quote
