Is there a way in c ++ / vc ++ / mfc so that I can verify that the remote machine is on the network or not. I do not want to use the ping command I tried to use the WSAConnect method but not on the remote network network, but it takes a lot of time to search. In that case application windho freezes for a long time. I need alternative methods to confirm remote machine network connectivity. Plz help
You can see that a host name exists and if DNS resolves an IP address It can, but it will not tell you whether it is online to determine if it is online, then you should exchange data with the host. To do this, the host should listen to a port, and send some sort of reaction.
Generally, the lowest common separator for the hosts is the ICMP packet - aka ping. You can write your own service in C ++ to send these UDP packets, and find an answer.
Some hosts and some router ICMP appear to be 'invisible'. If you know that your host accepts the connection on TCP port, then you can try to create a TCP socket. For example, from one shell you can test using nc
nc -z google.com 80 connection google.com 80 port [TCP / HT] succeeded!
If you do programming raw socket, you can try connecting to a host, and then make a selection () with a brief time call.
Comments
Post a Comment