1 # $Id: Ping.pm,v 1.16 2006-11-29 18:18:37 mike Exp $
3 # See the "Main" test package for documentation
5 package ZOOM::IRSpy::Test::Ping;
11 use ZOOM::IRSpy::Test;
12 our @ISA = qw(ZOOM::IRSpy::Test);
14 use ZOOM::IRSpy::Utils qw(isodate);
21 $conn->irspy_connect(undef, {},
22 ZOOM::Event::CONNECT, \&connected,
23 exception => \¬_connected);
27 sub connected { maybe_connected(@_, 1) }
28 sub not_connected { maybe_connected(@_, 0) }
31 my($conn, $task, $__UNUSED_udata, $event, $ok) = @_;
33 $conn->log("irspy_test", ($ok ? "" : "not "), "connected");
34 my $rec = $conn->record();
35 $rec->append_entry("irspy:status", "<irspy:probe ok='$ok'>" .
36 isodate(time()) . "</irspy:probe>");
37 return $ok ? ZOOM::IRSpy::Status::TEST_GOOD :
38 ZOOM::IRSpy::Status::TEST_BAD;