line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Patro::N3; |
2
|
6
|
|
|
6
|
|
1811
|
use Devel::GlobalDestruction; |
|
6
|
|
|
|
|
1821
|
|
|
6
|
|
|
|
|
29
|
|
3
|
6
|
|
|
6
|
|
686
|
use strict; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
115
|
|
4
|
6
|
|
|
6
|
|
78
|
use warnings; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
133
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# Patro::N3. Proxy class for CODE type references |
7
|
|
|
|
|
|
|
|
8
|
6
|
|
|
6
|
|
24
|
use Carp (); |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
81
|
|
9
|
6
|
|
|
6
|
|
23
|
use Socket (); |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
102
|
|
10
|
6
|
|
|
6
|
|
45
|
use Data::Dumper (); |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
352
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
use overload |
13
|
3
|
|
|
3
|
|
240
|
'&{}' => sub { ${$_[0]}->{sub} }, |
|
3
|
|
|
|
|
11
|
|
14
|
6
|
|
|
|
|
86
|
'nomethod' => \&Patro::LeumJelly::overload_handler, |
15
|
6
|
|
|
6
|
|
77
|
; |
|
6
|
|
|
|
|
14
|
|
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; |