und3f / anyevent-ping

Asynchronous ping with AnyEvent
2 stars 4 forks source link

Can't call method "send" on an undefined value #9

Closed mxmche closed 9 years ago

mxmche commented 9 years ago

Hello,

I have such error message after some time (~ 40s), running on debian 2.6.32-5-686:

Can't call method "send" on an undefined value at /root/perl5/perlbrew/perls/perl-5.14.4/lib/site_perl/5.14.4/AnyEvent/Ping.pm line 279.

It can be reproduced with this example:

https://gist.github.com/mxmche/e4d4fe0b69814fd8c546

und3f commented 9 years ago

As the $result is global variable script works not as supposed — it doesn't wait all pings before starting next. Also you don't need to create new AE::Ping each time.

Anyway it is a good idea to stop all pings on end(), so I improved end() in 929f994963f09c500e93df45a7b6397192cf5837. It will help to debug such problems in future.

mxmche commented 9 years ago

Thanks for the reply. I like this module!