Apache-Backend-POE
view release on metacpan or search on metacpan
lib/Apache/Backend/POE.pm view on Meta::CPAN
$PingTimeOut{$dsn} = 0 unless $PingTimeOut{$dsn};
$LastPingTime{$dsn} = 0 unless $LastPingTime{$dsn};
my $now = time;
my $needping = (($PingTimeOut{$dsn} == 0 or $PingTimeOut{$dsn} > 0)
and (($now - $LastPingTime{$dsn}) >= $PingTimeOut{$dsn})
) ? 1 : 0;
# print STDERR "$prefix need ping: ".($needping == 1 ? "yes" : "no")." \n" if $Apache::Backend::POE::DEBUG > 1;
$LastPingTime{$dsn} = $now;
# check first if there is already a object cached
# if this is the case, possibly verify the object
# using the ping-method. Use eval for checking the connection
# handle in order to avoid problems (dying inside ping) when
# handle is invalid.
# require Data::Dumper;
# print STDERR Data::Dumper->Dump([\%Connected]);
#if ($Connected{$Idx} and (!$needping or eval{$Connected{$Idx}->ping})) {
$needping = 1;
PING: {
if ($Connected{$Idx}) {
( run in 0.735 second using v1.01-cache-2.11-cpan-5467b0d2c73 )