line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::Slides::Client::TCP; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
|
4
|
6
|
|
|
6
|
|
28122
|
use version; our $VERSION = qv('0.0.3'); |
|
6
|
|
|
|
|
2062
|
|
|
6
|
|
|
|
|
44
|
|
5
|
|
|
|
|
|
|
|
6
|
6
|
|
|
6
|
|
640
|
use warnings; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
181
|
|
7
|
6
|
|
|
6
|
|
31
|
use strict; |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
186
|
|
8
|
6
|
|
|
6
|
|
28
|
use Carp; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
431
|
|
9
|
6
|
|
|
6
|
|
3787
|
use English qw( -no_match_vars ); |
|
6
|
|
|
|
|
12650
|
|
|
6
|
|
|
|
|
34
|
|
10
|
|
|
|
|
|
|
|
11
|
6
|
|
|
6
|
|
8562
|
use Object::InsideOut qw( WWW::Slides::Client::Base ); |
|
6
|
|
|
|
|
275995
|
|
|
6
|
|
|
|
|
41
|
|
12
|
6
|
|
|
6
|
|
4568
|
use IO::Socket; |
|
6
|
|
|
|
|
71007
|
|
|
6
|
|
|
|
|
35
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# Module implementation here |
15
|
|
|
|
|
|
|
my @port : Field # Port to connect to |
16
|
|
|
|
|
|
|
: Std(Name => 'port') : Get(Name => 'port') |
17
|
|
|
|
|
|
|
: Arg(Name => 'port', Mandatory => 1); |
18
|
|
|
|
|
|
|
my @host : Field # Host to connect to |
19
|
|
|
|
|
|
|
: Std(Name => 'host') : Get(Name => 'host') |
20
|
|
|
|
|
|
|
: Arg(Name => 'host', Default => 'localhost'); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _init : PreInit { |
23
|
6
|
|
|
0
|
|
50040
|
my $self = shift; |
24
|
6
|
|
|
|
|
14
|
my ($args) = @_; |
25
|
6
|
50
|
|
|
|
58
|
$args->{host} = 'localhost' unless exists $args->{host}; |
26
|
|
|
|
|
|
|
|
27
|
6
|
100
|
|
|
|
75
|
croak q{missing mandatory parameter 'port'} |
28
|
|
|
|
|
|
|
unless exists $args->{port}; |
29
|
|
|
|
|
|
|
|
30
|
4
|
100
|
|
|
|
66
|
my $sock = IO::Socket::INET->new( |
31
|
|
|
|
|
|
|
PeerAddr => $args->{host}, |
32
|
|
|
|
|
|
|
PeerPort => $args->{port}, |
33
|
|
|
|
|
|
|
) or croak "no socket for $args->{host}:$args->{port}"; |
34
|
|
|
|
|
|
|
|
35
|
2
|
|
|
|
|
2154
|
$args->{in_handle} = $sock; |
36
|
2
|
|
|
|
|
22
|
$args->{out_handle} = $sock; |
37
|
|
|
|
|
|
|
|
38
|
2
|
|
|
|
|
18
|
return; |
39
|
6
|
|
|
6
|
|
4548
|
} |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
39
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; # Magic true value required at end of module |
44
|
|
|
|
|
|
|
__END__ |