Click to See Complete Forum and Search --> : need of c++ command


flutie98
10-01-2003, 12:23 PM
i need to know the command to ping a server in c++
anyone know it?

gameboy1234
10-01-2003, 04:14 PM
There is no C++ "command" to call ping. It's a library call, if anything.

You're best bet might be to use the system() function (or whatever is the equivalent in your dialect of C++) to just call the ping command. E.g. system("ping <ip-addr>") and check the return code.

Or you could try the tcp.h library on your system. Ping is ICMP protocol, not tcp or udp, so you actually might have to dig around some. Or download the source for a working ping command and see what they use.

flutie98
10-02-2003, 10:48 AM
Originally posted by gameboy1234
There is no C++ "command" to call ping. It's a library call, if anything.

You're best bet might be to use the system() function (or whatever is the equivalent in your dialect of C++) to just call the ping command. E.g. system("ping <ip-addr>") and check the return code.

Or you could try the tcp.h library on your system. Ping is ICMP protocol, not tcp or udp, so you actually might have to dig around some. Or download the source for a working ping command and see what they use.

thank you sir i will look into that