What's the best way to ping many network devices in parallel?

Dr.eel picture Dr.eel · Feb 3, 2011 · Viewed 9.7k times · Source

I poll a lot of devices in network (more than 300) by iterative ping.

The program polls the devices sequentially, so it's slow. I'd like to enhance the speed of polling.

There some ways to do this in Delphi 7:

  1. Each device has a thread doing ping. Manage threads manually.
  2. Learn and use Indy 10. Need examples.
  3. Use overlapped I/O based on window messages.
  4. Use completion ports based on events.

What is faster, easier? Please, provide some examples or links for example.

Answer

Lloyd picture Lloyd · Feb 3, 2011

Flooding the network with ICMP is not a good idea.

You might want to consider some kind of thread pool and queue up the ping requests and have a fixed number of threads doing the requests.