line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::WebSocket::Message; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
90651
|
use strict; |
|
3
|
|
|
|
|
20
|
|
|
3
|
|
|
|
|
83
|
|
4
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
73
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
488
|
use Call::Context (); |
|
3
|
|
|
|
|
385
|
|
|
3
|
|
|
|
|
582
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
5
|
50
|
|
5
|
0
|
27
|
if (!$_[1]->isa('Net::WebSocket::Frame')) { |
10
|
0
|
|
|
|
|
0
|
die( (caller 0)[3] . ' needs at least one Net::WebSocket::Frame object!' ); |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
5
|
|
|
|
|
20
|
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
|
4
|
|
|
4
|
0
|
100
|
my ($self) = @_; |
26
|
|
|
|
|
|
|
|
27
|
4
|
|
|
|
|
8
|
return join( q<>, map { $_->get_payload() } @$self ); |
|
6
|
|
|
|
|
21
|
|
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
|
5
|
|
|
5
|
0
|
11
|
my $type = $_[0]->get_type(); |
41
|
|
|
|
|
|
|
|
42
|
5
|
|
|
|
|
11
|
my $class = __PACKAGE__ . "::$type"; |
43
|
5
|
100
|
|
|
|
29
|
if (!$class->can('new')) { |
44
|
2
|
|
|
|
|
6
|
Module::Load::load($class); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
5
|
|
|
|
|
35
|
return $class->new(@_); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |