line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::WebSocket::Message; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
98460
|
use strict; |
|
4
|
|
|
|
|
26
|
|
|
4
|
|
|
|
|
98
|
|
4
|
4
|
|
|
4
|
|
18
|
use warnings; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
91
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
800
|
use Call::Context (); |
|
4
|
|
|
|
|
593
|
|
|
4
|
|
|
|
|
783
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
10
|
50
|
|
10
|
0
|
78
|
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
|
|
|
|
|
47
|
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
|
153
|
my ($self) = @_; |
26
|
|
|
|
|
|
|
|
27
|
12
|
|
|
|
|
37
|
return join( q<>, map { $_->get_payload() } @$self ); |
|
15
|
|
|
|
|
63
|
|
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
|
62
|
my $type = $_[0]->get_type(); |
41
|
|
|
|
|
|
|
|
42
|
10
|
|
|
|
|
35
|
my $class = __PACKAGE__ . "::$type"; |
43
|
10
|
100
|
|
|
|
92
|
if (!$class->can('new')) { |
44
|
5
|
|
|
|
|
19
|
Module::Load::load($class); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
10
|
|
|
|
|
100
|
return $class->new(@_); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |