[concurrency-interest] Creating a Set of pings

robert lazarski robertlazarski at gmail.com
Mon May 22 20:54:52 EDT 2006

Could someone please give some advice on these requirements?

1) Find all IP's on a given subnet that responds to ICMP  (ping). So for say with a netmask of, attempt a ping to 255
addresses. In java  I believe I can use InetAddress.isReachable(timeout) .

2) On a valid IP, try to connect on port 161 via UDP and snmp.

3) Put the valid IP's inside an implementation of java.util.Set .

4) Compare new Set with a previous Set and show updates.

My questions are:

1) Perform steps 1, 2, and possibly 3 in a Callable or Runnable. On typical
intel hardware does an ExecutorService with a size of 5 sound about right?
2) Should I pass in a Callable and get the results back 255 times, or should
I use Runnable and have the threads write the result to a common area, ie,
an object with a synchronized method ?
3) Should I use one of the concurrent collections to store the results?
CopyOnWriteArrayList seems to fit.

Thanks for any help,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20060522/9b8d465f/attachment.html 

More information about the Concurrency-interest mailing list