Given the range of IP addresses entered by the user (using various means), I want to determine which of these machines has software that I can talk to.
Here's the main process:
Ping these addresses to find available machines
Connect to a known socket on available machines
Sending a message to successfully installed sockets
Compare the answer to the expected answer
Steps 2-4 are right for me. What is the best way to implement the first step in .NET?
I am looking at the System.Net.NetworkInformation.Ping class. Do I have to run multiple addresses at the same time to speed up the process? If I ping one address at a time with a long timeout, it can take a long time. But with a short timeout, I can skip several available machines.
Sometimes pings seem to fail, even when I know that the address points to the active machine. Is it necessary to twice ping in case of refusal of the request?
First of all, when I scan large collections of addresses with the network cable disconnected, Ping throws a NullReferenceException in FreeUnmanagedResources ().!?
Any pointers to a better approach for scanning a range of IP addresses like this?
source share