WebSocket/Frame/text.pm

filter: Statementstmt 100% 13 / 13 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 100% 17 / 17 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« WebSocket/Frame/pong.pm ↑ Summary WebSocket/Masker/Server.pm »
1 package Net::WebSocket::Frame::text;
2  
3 =encoding utf-8
4  
5 =head1 NAME
6  
7 Net::WebSocket::Frame::text
8  
9 =head1 SYNOPSIS
10  
11 B<NOTE:> Before you instantiate this class directly, look at
12 L<Net::WebSocket::Endpoint>’s C<create_message()> convenience
13 method to make your life easier.
14  
15 my $frm = Net::WebSocket::Frame::text->new(
16  
17 #This flag defaults to on
18 fin => 1,
19  
20 #For servers, this must be empty (default).
21 #For clients, this must be four random bytes.
22 mask => q<>,
23  
24 payload => $payload_text,
25 );
26  
27 $frm->get_type(); #"text"
28  
29 $frm->is_control(); #0
30  
31 my $mask = $frm->get_mask_bytes();
32  
33 my $payload = $frm->get_payload();
34  
35 my $serialized = $frm->to_bytes();
36  
37 $frm->set_fin(); #turns on
38  
39 =cut
40  
41 13 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
42 13 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
43  
44 13 ▶use parent qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
45 Net::WebSocket::Base::DataFrame
46 13 );
47  
48 13 ▶use constant get_opcode => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
49  
50 13 1;
« WebSocket/Frame/pong.pm ↑ Summary WebSocket/Masker/Server.pm »