line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Patro::N3; |
2
|
6
|
|
|
6
|
|
1729
|
use Devel::GlobalDestruction; |
|
6
|
|
|
|
|
1743
|
|
|
6
|
|
|
|
|
52
|
|
3
|
6
|
|
|
6
|
|
693
|
use strict; |
|
6
|
|
|
|
|
28
|
|
|
6
|
|
|
|
|
131
|
|
4
|
6
|
|
|
6
|
|
33
|
use warnings; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
139
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# Patro::N3. Proxy class for CODE type references |
7
|
|
|
|
|
|
|
|
8
|
6
|
|
|
6
|
|
27
|
use Carp (); |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
92
|
|
9
|
6
|
|
|
6
|
|
25
|
use Socket (); |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
119
|
|
10
|
6
|
|
|
6
|
|
28
|
use Data::Dumper (); |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
344
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
use overload |
13
|
3
|
|
|
3
|
|
240
|
'&{}' => sub { ${$_[0]}->{sub} }, |
|
3
|
|
|
|
|
14
|
|
14
|
6
|
|
|
|
|
83
|
'nomethod' => \&Patro::LeumJelly::overload_handler, |
15
|
6
|
|
|
6
|
|
28
|
; |
|
6
|
|
|
|
|
11
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub DESTROY { |
18
|
0
|
|
|
0
|
|
|
my $self = shift; |
19
|
0
|
0
|
|
|
|
|
return if in_global_destruction(); |
20
|
0
|
0
|
|
|
|
|
if ($$self->{_DESTROY}++) { |
21
|
0
|
|
|
|
|
|
return; |
22
|
|
|
|
|
|
|
} |
23
|
0
|
|
|
|
|
|
my $socket = $$self->{socket}; |
24
|
0
|
0
|
|
|
|
|
if ($socket) { |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# XXX - shouldn't disconnect on every object destruction, |
27
|
|
|
|
|
|
|
# only when all of the wrapped objects associated with a |
28
|
|
|
|
|
|
|
# client have been destroyed, or during global |
29
|
|
|
|
|
|
|
# destruction |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my $response = Patro::LeumJelly::proxy_request( |
32
|
|
|
|
|
|
|
$$self, |
33
|
|
|
|
|
|
|
{ id => $$self->{id}, |
34
|
0
|
|
|
|
|
|
topic => 'META', |
35
|
|
|
|
|
|
|
#command => 'disconnect' } ); |
36
|
|
|
|
|
|
|
command => 'destroy' } ); |
37
|
0
|
0
|
|
|
|
|
if ($response->{disconnect_ok}) { |
38
|
0
|
|
|
|
|
|
close $socket; |
39
|
0
|
|
|
|
|
|
delete $$self->{socket}; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
# is an AUTOLOAD method useful here? |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
############################################################ |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |