My application needs to ping several IP addresses at once for speed of code execution. For example, pinging 300 ip-addresses, that a timeout in one second will take 5 minutes, whereas if 20 are performed simultaneously, it will take about 15 seconds.
I tried calling windows ping.exe for this, but I had two separate and similar problems. One of the problems is that on some Windows machines, ping will just hang for a minute, apparently for no reason until I kill the thread and it dies. Another problem: we had ping.exe, which completely crashed to machines before, where any ping.exe call lasts forever, so hundreds of ping.exe processes begin to accumulate until the machine crashes, and start ping.exe manually from the line command in this case will simply leave another ping process forever.
I tried using a library called icmp4j , but this library only allows one ping on Windows.
I tried this user code and ended up having problems on my local network. When checking a local address that does not exist (on your subnet), apparently you can get a response that says that the address is not available. For exactly 50% of these answers, I get a timeout, and on the other hand, 50% get "inappropriate."
Does anyone know a method to simultaneously run multiple pings on windows without using icmp4j or ping.exe?
source
share