File Coverage

blib/lib/Net/WebSocket/Frame/text.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
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 Before you instantiate this class directly, look at
12             L’s C 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     13   301222 use strict;
  13         70  
  13         473  
42 13     13   119 use warnings;
  13         46  
  13         415  
43              
44 13         80 use parent qw(
45             Net::WebSocket::Base::DataFrame
46 13     13   1617 );
  13         1065  
47              
48 13     13   698 use constant get_opcode => 1;
  13         25  
  13         813  
49              
50             1;