line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# You may distribute under the terms of either the GNU General Public License |
2
|
|
|
|
|
|
|
# or the Artistic License (the same terms as Perl itself) |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# (C) Paul Evans, 2010-2011 -- leonerd@leonerd.org.uk |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Net::Async::Tangence::ServerProtocol; |
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
913
|
use strict; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
101
|
|
9
|
4
|
|
|
4
|
|
13
|
use warnings; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
90
|
|
10
|
|
|
|
|
|
|
|
11
|
4
|
|
|
4
|
|
12
|
use base qw( Net::Async::Tangence::Protocol Tangence::Server ); |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
1627
|
|
12
|
4
|
|
|
4
|
|
16985
|
use mro 'c3'; |
|
4
|
|
|
|
|
2594
|
|
|
4
|
|
|
|
|
13
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '0.14'; |
15
|
|
|
|
|
|
|
|
16
|
4
|
|
|
4
|
|
163
|
use Carp; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
664
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 NAME |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
C - C |
21
|
|
|
|
|
|
|
subclass for servers |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 DESCRIPTION |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
This subclass of L provides additional logic |
26
|
|
|
|
|
|
|
required by the server side of a connection. It is not intended to be directly |
27
|
|
|
|
|
|
|
used by server implementations. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub _init |
32
|
|
|
|
|
|
|
{ |
33
|
4
|
|
|
4
|
|
102
|
my $self = shift; |
34
|
4
|
|
|
|
|
6
|
my ( $params ) = @_; |
35
|
|
|
|
|
|
|
|
36
|
4
|
|
|
|
|
35
|
$self->registry( delete $params->{registry} ); |
37
|
|
|
|
|
|
|
|
38
|
4
|
|
50
|
|
|
50
|
$params->{on_closed} ||= undef; |
39
|
|
|
|
|
|
|
|
40
|
4
|
|
|
|
|
26
|
$self->SUPER::_init( $params ); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub configure |
44
|
|
|
|
|
|
|
{ |
45
|
8
|
|
|
8
|
1
|
19
|
my $self = shift; |
46
|
8
|
|
|
|
|
13
|
my %params = @_; |
47
|
|
|
|
|
|
|
|
48
|
8
|
100
|
|
|
|
17
|
if( exists $params{on_closed} ) { |
49
|
4
|
|
|
|
|
7
|
my $on_closed = $params{on_closed}; |
50
|
|
|
|
|
|
|
$params{on_closed} = sub { |
51
|
2
|
|
|
2
|
|
4
|
my $self = shift; |
52
|
|
|
|
|
|
|
|
53
|
2
|
50
|
|
|
|
9
|
$on_closed->( $self ) if $on_closed; |
54
|
4
|
|
|
|
|
16
|
}; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
8
|
|
|
|
|
33
|
$self->SUPER::configure( %params ); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 AUTHOR |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Paul Evans |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
0x55AA; |