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
|
|
1206
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
97
|
|
9
|
4
|
|
|
4
|
|
21
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
109
|
|
10
|
|
|
|
|
|
|
|
11
|
4
|
|
|
4
|
|
18
|
use base qw( Net::Async::Tangence::Protocol Tangence::Server ); |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
2516
|
|
12
|
4
|
|
|
4
|
|
24376
|
use mro 'c3'; |
|
4
|
|
|
|
|
3702
|
|
|
4
|
|
|
|
|
17
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = '0.13'; |
15
|
|
|
|
|
|
|
|
16
|
4
|
|
|
4
|
|
205
|
use Carp; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
880
|
|
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
|
|
132
|
my $self = shift; |
34
|
4
|
|
|
|
|
10
|
my ( $params ) = @_; |
35
|
|
|
|
|
|
|
|
36
|
4
|
|
|
|
|
47
|
$self->registry( delete $params->{registry} ); |
37
|
|
|
|
|
|
|
|
38
|
4
|
|
50
|
|
|
71
|
$params->{on_closed} ||= undef; |
39
|
|
|
|
|
|
|
|
40
|
4
|
|
|
|
|
32
|
$self->SUPER::_init( $params ); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub configure |
44
|
|
|
|
|
|
|
{ |
45
|
8
|
|
|
8
|
1
|
31
|
my $self = shift; |
46
|
8
|
|
|
|
|
24
|
my %params = @_; |
47
|
|
|
|
|
|
|
|
48
|
8
|
100
|
|
|
|
29
|
if( exists $params{on_closed} ) { |
49
|
4
|
|
|
|
|
7
|
my $on_closed = $params{on_closed}; |
50
|
|
|
|
|
|
|
$params{on_closed} = sub { |
51
|
2
|
|
|
2
|
|
5
|
my $self = shift; |
52
|
|
|
|
|
|
|
|
53
|
2
|
50
|
|
|
|
19
|
$on_closed->( $self ) if $on_closed; |
54
|
4
|
|
|
|
|
33
|
}; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
8
|
|
|
|
|
45
|
$self->SUPER::configure( %params ); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 AUTHOR |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Paul Evans |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
0x55AA; |