| 1 | package Net::WebSocket::PMCE::Data; | ||
| 2 | |||
| 3 | 3 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 3 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 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<OBJ>->message_is_compressed( MESSAGE ) | ||
| 19 | |||
| 20 | MESSAGE is an instance of L<Net::WebSocket::Message>. | ||
| 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 | ▶ | return ($_[1]->get_frames())[0]->has_rsv1(); |
|
Subroutine
message_is_compressed: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 32 | } | ||
| 33 | |||
| 34 | =head2 INITIAL_FRAME_RSV() | ||
| 35 | |||
| 36 | Returns the numeric value of the RSV bits for PMCEs, | ||
| 37 | suitable for giving to a L<Net::WebSocket::Frame> subclass’s | ||
| 38 | constructor. | ||
| 39 | |||
| 40 | =cut | ||
| 41 | |||
| 42 | use constant { | ||
| 43 | 3 | INITIAL_FRAME_RSV => 0b100, #RSV1 | |
| 44 | 3 | ▶ | }; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 45 | |||
| 46 | 3 | 1; | |