I was looking some C++ library/method to check if a host is live in my LAN (and also if a specif port). Thank you in advance !
Asked
Active
Viewed 2,993 times
0
-
If ping is enabled on that host, you can invoke ping it programatically. If your host is running some sort of server, you could connect to it (it will prove life but not death) – MonoThreaded Jan 30 '15 at 16:49
-
This is a pretty broad question. What have you tried so far? Why not just use sockets? Is this the sole purpose of this program? What does `alive` mean (i.e., that it is pingable? That it's listening for TCP connections on a specific port?). – Julian Jan 30 '15 at 16:56
-
My idea is to find the host which is connected to my LAN and if their opened ports. – I love coding Jan 30 '15 at 17:03
-
What is the method for C++, to open a socket to a specif IP and PORT ? – I love coding Feb 03 '15 at 08:03
1 Answers
1
you didnt mention a platfrom. So I will guess linux.
What is the best method to ping in c++ under linux?
if windows use the iphelper library - that allows ping
https://msdn.microsoft.com/en-us/library/windows/desktop/aa366073%28v=vs.85%29.aspx