line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::WebSocket::Message; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
18
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
4
|
use Call::Context (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
13
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
4
|
use Net::WebSocket::Constants (); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
303
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $AUTOLOAD; |
11
|
|
|
|
|
|
|
sub AUTOLOAD { |
12
|
9
|
|
|
9
|
|
6298
|
my ($self) = shift; |
13
|
|
|
|
|
|
|
|
14
|
9
|
100
|
|
|
|
54
|
return if substr( $AUTOLOAD, -8 ) eq ':DESTROY'; |
15
|
|
|
|
|
|
|
|
16
|
4
|
|
|
|
|
8
|
my $last_colon_idx = rindex( $AUTOLOAD, ':' ); |
17
|
4
|
|
|
|
|
9
|
my $method = substr( $AUTOLOAD, 1 + $last_colon_idx ); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
#Figure out what type this is, and re-bless. |
20
|
4
|
50
|
|
|
|
8
|
if (ref($self) eq __PACKAGE__) { |
21
|
4
|
|
|
|
|
13
|
my $type = $self->[0]->get_type(); |
22
|
|
|
|
|
|
|
|
23
|
4
|
|
|
|
|
9
|
my $class = __PACKAGE__ . "::$type"; |
24
|
4
|
50
|
|
|
|
33
|
if (!$class->can('new')) { |
25
|
4
|
|
|
|
|
11
|
Module::Load::load($class); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
4
|
|
|
|
|
128
|
bless $self, $class; |
29
|
|
|
|
|
|
|
|
30
|
4
|
50
|
|
|
|
26
|
if ($self->can($method)) { |
31
|
4
|
|
|
|
|
11
|
return $self->$method(@_); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
0
|
die( "$self has no method “$method”!" ); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
#---------------------------------------------------------------------- |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub create_from_frames { |
41
|
5
|
|
|
5
|
0
|
20
|
return bless \@_, __PACKAGE__; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub get_frames { |
45
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
0
|
Call::Context::must_be_list(); |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
0
|
return @$self; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub get_payload { |
53
|
4
|
|
|
4
|
0
|
104
|
my ($self) = @_; |
54
|
|
|
|
|
|
|
|
55
|
4
|
|
|
|
|
13
|
return join( q<>, map { $_->get_payload() } @$self ); |
|
6
|
|
|
|
|
22
|
|
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub to_bytes { |
59
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
return join( q<>, map { $_->to_bytes() } @$self ); |
|
0
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |