line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::WebSocket::PMCE::Data; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
1346
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
85
|
|
4
|
3
|
|
|
3
|
|
12
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
214
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=encoding utf-8 |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Net::WebSocket::PMCE::Data - Base class for PMCE data modules. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 DESCRIPTION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 METHODS |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Available on all instances: |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head2 I->message_is_compressed( MESSAGE ) |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
MESSAGE is an instance of L. |
21
|
|
|
|
|
|
|
The output is a Perl boolean that indicates whether the message |
22
|
|
|
|
|
|
|
appears to be PMCE-compressed. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
You can also call this as a class method, e.g.: |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Net::WebSocket::PMCE->message_is_compressed( $message_obj ); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub message_is_compressed { |
31
|
0
|
|
|
0
|
1
|
|
return ($_[1]->get_frames())[0]->has_rsv1(); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
#There is no frame_is_compressed() because compression |
35
|
|
|
|
|
|
|
#is only supposed to apply to messages. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head2 INITIAL_FRAME_RSV() |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Returns the numeric value of the RSV bits for PMCEs, |
40
|
|
|
|
|
|
|
suitable for giving to a L subclass’s |
41
|
|
|
|
|
|
|
constructor. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
use constant { |
46
|
3
|
|
|
|
|
291
|
INITIAL_FRAME_RSV => 0b100, #RSV1 |
47
|
3
|
|
|
3
|
|
20
|
}; |
|
3
|
|
|
|
|
6
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |