line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::WebSocket::Message; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
90680
|
use strict; |
|
4
|
|
|
|
|
24
|
|
|
4
|
|
|
|
|
102
|
|
4
|
4
|
|
|
4
|
|
16
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
80
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
661
|
use Call::Context (); |
|
4
|
|
|
|
|
598
|
|
|
4
|
|
|
|
|
799
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
10
|
50
|
|
10
|
0
|
70
|
if (!$_[1]->isa('Net::WebSocket::Frame')) { |
10
|
0
|
|
|
|
|
0
|
die( (caller 0)[3] . ' needs at least one Net::WebSocket::Frame object!' ); |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
10
|
|
|
|
|
42
|
return bless \@_, shift; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub get_frames { |
17
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
0
|
Call::Context::must_be_list(); |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
0
|
return @$self; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub get_payload { |
25
|
12
|
|
|
12
|
0
|
160
|
my ($self) = @_; |
26
|
|
|
|
|
|
|
|
27
|
12
|
|
|
|
|
31
|
return join( q<>, map { $_->get_payload() } @$self ); |
|
15
|
|
|
|
|
61
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub to_bytes { |
31
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
0
|
return join( q<>, map { $_->to_bytes() } @$self ); |
|
0
|
|
|
|
|
0
|
|
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#---------------------------------------------------------------------- |
37
|
|
|
|
|
|
|
# Static function that auto-loads the actual message class. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub create_from_frames { |
40
|
10
|
|
|
10
|
0
|
70
|
my $type = $_[0]->get_type(); |
41
|
|
|
|
|
|
|
|
42
|
10
|
|
|
|
|
28
|
my $class = __PACKAGE__ . "::$type"; |
43
|
10
|
100
|
|
|
|
74
|
if (!$class->can('new')) { |
44
|
5
|
|
|
|
|
16
|
Module::Load::load($class); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
10
|
|
|
|
|
93
|
return $class->new(@_); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |