line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lim::RPC::Protocol; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
16970
|
use common::sense; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
37
|
|
4
|
3
|
|
|
3
|
|
241
|
use Carp; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
307
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
21
|
use Scalar::Util qw(blessed weaken); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
305
|
|
7
|
3
|
|
|
3
|
|
20
|
use Log::Log4perl (); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
59
|
|
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
16
|
use Lim (); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
2671
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=encoding utf8 |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
... |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 VERSION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
See L for version. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our $VERSION = $Lim::VERSION; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 SYNOPSIS |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
... |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head2 new |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=cut |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub new { |
36
|
2
|
|
|
2
|
1
|
6
|
my $this = shift; |
37
|
2
|
|
33
|
|
|
13
|
my $class = ref($this) || $this; |
38
|
2
|
|
|
|
|
11
|
my %args = ( @_ ); |
39
|
2
|
|
|
|
|
21
|
my $self = { |
40
|
|
|
|
|
|
|
logger => Log::Log4perl->get_logger |
41
|
|
|
|
|
|
|
}; |
42
|
2
|
|
|
|
|
1222
|
bless $self, $class; |
43
|
|
|
|
|
|
|
|
44
|
2
|
50
|
33
|
|
|
109
|
unless (blessed($args{server}) and $args{server}->isa('Lim::RPC::Server')) { |
45
|
0
|
|
|
|
|
0
|
confess __PACKAGE__, ': No server specified or invalid'; |
46
|
|
|
|
|
|
|
} |
47
|
2
|
|
|
|
|
23
|
$self->{__server} = $args{server}; |
48
|
2
|
|
|
|
|
11
|
weaken($self->{__server}); |
49
|
|
|
|
|
|
|
|
50
|
2
|
|
|
|
|
13
|
$self->Init(@_); |
51
|
|
|
|
|
|
|
|
52
|
2
|
50
|
|
|
|
39
|
Lim::OBJ_DEBUG and $self->{logger}->debug('new ', __PACKAGE__, ' ', $self); |
53
|
2
|
|
|
|
|
1167
|
$self; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub DESTROY { |
57
|
2
|
|
|
2
|
|
6
|
my ($self) = @_; |
58
|
2
|
50
|
|
|
|
9
|
Lim::OBJ_DEBUG and $self->{logger}->debug('destroy ', __PACKAGE__, ' ', $self); |
59
|
|
|
|
|
|
|
|
60
|
2
|
|
|
|
|
1081
|
$self->Destroy; |
61
|
2
|
|
|
|
|
376
|
delete $self->{__server}; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 Init |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
0
|
1
|
0
|
sub Init { |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 Destroy |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |
74
|
|
|
|
|
|
|
|
75
|
0
|
|
|
0
|
1
|
0
|
sub Destroy { |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 name |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=cut |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub name { |
83
|
0
|
|
|
0
|
1
|
0
|
confess 'function name not overloaded'; |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head2 serve |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=cut |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub serve { |
91
|
0
|
|
|
0
|
1
|
0
|
confess 'function serve not overloaded'; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head2 handle |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=cut |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub handle { |
99
|
0
|
|
|
0
|
1
|
0
|
confess 'function handle not overloaded'; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head2 timeout |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=cut |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub timeout { |
107
|
0
|
|
|
0
|
1
|
0
|
confess 'function timeout not overloaded'; |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head2 server |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=cut |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
sub server { |
115
|
2
|
|
|
2
|
1
|
336
|
$_[0]->{__server}; |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head2 precall |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=cut |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
sub precall { |
123
|
2
|
|
|
2
|
1
|
5
|
shift; # $self |
124
|
2
|
|
|
|
|
5
|
shift; # $call |
125
|
2
|
|
|
|
|
14
|
return @_; |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head1 AUTHOR |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
Jerry Lundström, C<< >> |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head1 BUGS |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
Please report any bugs or feature requests to L. |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=head1 SUPPORT |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
perldoc Lim |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
You can also look for information at: |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=over 4 |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=item * Lim issue tracker (report bugs here) |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
L |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=back |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
Copyright 2012-2013 Jerry Lundström. |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
159
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
160
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=cut |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
1; # End of Lim::RPC::Protocol |