1bfb8c4c4ca50c4290410ecbe0899110242a6bc3
[irspy-moved-to-github.git] / lib / ZOOM / IRSpy / Task / Connect.pm
1 # $Id: Connect.pm,v 1.1 2006-10-06 11:33:08 mike Exp $
2
3 # See ZOOM/IRSpy/Task/Search.pm for documentation
4
5 package ZOOM::IRSpy::Task::Connect;
6
7 use 5.008;
8 use strict;
9 use warnings;
10
11 use ZOOM::IRSpy::Task;
12 our @ISA = qw(ZOOM::IRSpy::Task);
13
14 sub new {
15     my $class = shift();
16
17     return $class->SUPER::new(@_);
18 }
19
20 sub run {
21     my $this = shift();
22
23     my $conn = $this->conn();
24     $this->irspy()->log("irspy_test", $conn->option("host"),
25                         " connecting");
26     # Actually, connections have already been connected.  Redoing this
27     # won't hurt -- in fact, it's a no-op.  But because it's a no-op,
28     # it doesn't cause any events, which means that the very next call
29     # of ZOOM::event() will return 0, and IRSpy will fall through the
30     # event loop.  Not good.  Not sure how to fix this.
31     $conn->connect($conn->option("host"));
32 }
33
34 sub render {
35     my $this = shift();
36     return ref($this) . " " . $this->conn()->option("host");
37 }
38
39 use overload '""' => \&render;
40
41 1;