tye's node here was very enlightening, and provided most of the information I needed. I then proceeded to scan through the modules@perl.org archives and the comp.lang.perl.* newsgroups -- it seems that a lot of people are dissatisfied with this module, but noone appears to have made a decent attempt to fix it. So, I've collected a bunch of suggestions that I have for improvements to the module. I've collected them here for public discussion... I'll appreciate any further suggestions & comments from anyone. :)
Update: See Net::Ping::External for my first attempt at implementing suggestion #2.
Once this has been discussed, I plan on doing the Nice Thing and e-mailing the module's author regarding the proposed changes; I'll have to see what kind of response (if any) I get from him before I go too much further. At any rate, here are the suggestions:
pingecho() or a ping object with the tcp protocol use alarm() to implement the timeout. So, don't use alarm() in your program while you are using pingecho() or a ping object with the tcp protocol. The udp and icmp protocols do not use alarm() to implement the timeout.
This call would fork() $num_forks children and have each of them start attempts to ping different hosts in the @list_of_hosts until the list is empty. All hosts in the list which are alive will be returned by the call to ping(). This would be especially useful for pinging a largish network of computers: in general, an attempt to ping n hosts will occur in worst-case time of n * $timeout / $numforks instead of n * $timeout. If fork() or CreateProcess() is not implemented on the system, this call would issue a warning, and then start pinging each of the hosts in sequence, returning the list when done.$p = Net::Ping->new(); $p->ping(\@list_of_hosts, $timeout, $num_forks);
Also, I have no easy access to a Windows NT box w/Perl (I've only got access to Solaris, IRIX, Linux, OpenBSD, and Win9x boxen here); if I end up going ahead with this and need an NT box to test on, would there be any monks willing to help me out? Anyone else who has a more exotic system would also be of use for testing.
Thanks in advance for any input you may have.
In reply to A proposal for improvements to Net::Ping by Falkkin
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |