Re: PoCo::Client::Ping intermittently fails to emit pings
Rocco Caputo <[email protected]>
| Newsgroups | gmane.comp.lang.perl.poe |
|---|---|
| Message-ID | <[email protected]> |
ICMP is not a reliable network protocol. IP is allowed to drop the packets without notice. The only way to detect the case is when too much time has elapsed without a response---$timeout is reached. Enqueuing your request in the event queue is not the same thing as sending an ICMP packet. post() may succeed where the ping fails. -- Rocco Caputo - [email protected] On Apr 19, 2009, at 12:44, Stuart Kendrick wrote: > If the OS fails to execute a ping, does there exist a mechanism for > the OS to tell POE about that? And for me to 'notice' such an > incident? > > I was hoping that checking the return value on a 'post' would do > that ... but thus far, no dice (i.e. the box on which my script is > running intermittently fails to emit pings, but by script doesn't > log anything.) > > [...] > # "Pinger, do a ping and return the results as a pong event. The > # address to ping is $addr." > $result = $kernel->post( 'pinger', > 'ping', > 'pong', > $addr, > $timeout, > ); > log_error("Problem pinging $addr: $!") unless $result; > [...] > > From http://search.cpan.org/~rcaputo/POE-1.004/lib/POE/Kernel.pm#post_DESTINATION,_EVENT_NAME_ > [,_PARAMETER_LIST] > > "post() returns a Boolean value indicating whether the message was > successfully enqueued. If post() returns false, $! is set to explain > the failure:" > > --sk > > > Stuart Kendrick wrote: >> my favorite pinging application (in-house app, uses >> POE::Component::Client::Ping) intermittently reports a rash of >> missed replies. happens roughly the same time each night; the >> condition lasts for several minutes