X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy%2FTask%2FConnect.pm;fp=lib%2FZOOM%2FIRSpy%2FTask%2FConnect.pm;h=1bfb8c4c4ca50c4290410ecbe0899110242a6bc3;hb=880bb74a2cc77e58aa99cbaeb300435316417e76;hp=0000000000000000000000000000000000000000;hpb=378c5b5e691e85900047ef38a913cc69b6537edc;p=irspy-moved-to-github.git diff --git a/lib/ZOOM/IRSpy/Task/Connect.pm b/lib/ZOOM/IRSpy/Task/Connect.pm new file mode 100644 index 0000000..1bfb8c4 --- /dev/null +++ b/lib/ZOOM/IRSpy/Task/Connect.pm @@ -0,0 +1,41 @@ +# $Id: Connect.pm,v 1.1 2006-10-06 11:33:08 mike Exp $ + +# See ZOOM/IRSpy/Task/Search.pm for documentation + +package ZOOM::IRSpy::Task::Connect; + +use 5.008; +use strict; +use warnings; + +use ZOOM::IRSpy::Task; +our @ISA = qw(ZOOM::IRSpy::Task); + +sub new { + my $class = shift(); + + return $class->SUPER::new(@_); +} + +sub run { + my $this = shift(); + + my $conn = $this->conn(); + $this->irspy()->log("irspy_test", $conn->option("host"), + " connecting"); + # Actually, connections have already been connected. Redoing this + # won't hurt -- in fact, it's a no-op. But because it's a no-op, + # it doesn't cause any events, which means that the very next call + # of ZOOM::event() will return 0, and IRSpy will fall through the + # event loop. Not good. Not sure how to fix this. + $conn->connect($conn->option("host")); +} + +sub render { + my $this = shift(); + return ref($this) . " " . $this->conn()->option("host"); +} + +use overload '""' => \&render; + +1;