Multiping is a library for efficiently pinging lots of hosts. No matter how many hosts you start pinging a single Socket will only open one raw socket listner (two if you are pinging both IPv4 and IPv6 hosts).
The socket will only be listening as long as you have an active ping running.
Note that this library only performs ICMP based pings, which means it must be
run as root or have the appropriate capabilities set. To run tests, or use go run
try go test -exec sudo
or go run -exec sudo
.
See the godoc for more details or look at the example ping command implementation in ping.go.