WebSocket/Frame/pong.pm

filter: Statementstmt 100% 15 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 95.2% 20 / 21 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« WebSocket/Frame/ping.pm ↑ Summary WebSocket/Base/DataMessage.pm »
1 package Net::WebSocket::Frame::pong;
2  
3 =encoding utf-8
4  
5 =HEAD1
6  
7 Net::WebSocket::Frame::pong
8  
9 =head1 SYNOPSIS
10  
11 my $frm = Net::WebSocket::Frame::pong->new(
12  
13 #Optional, can be either empty (default) or four random bytes
14 mask => q<>,
15  
16 payload_sr => \$payload,
17 );
18  
19 $frm->get_type(); #"ping"
20  
21 $frm->is_control_frame(); #1
22  
23 my $mask = $frm->get_mask_bytes();
24  
25 my $payload = $frm->get_payload();
26  
27 my $serialized = $frm->to_bytes();
28  
29 Note that, L<as per RFC 6455|https://tools.ietf.org/html/rfc6455#section-5.5>,
30 pong messages can have only up to 125 bytes in their payload.
31  
32 =cut
33  
34 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
35 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
36  
37 2 use parent qw(
38 Net::WebSocket::Base::ControlFrame
39 2 ▶);
Subroutine BEGIN: called CC=1 SCAR=0.0
40  
41 2 ▶use constant get_opcode => 10;
Subroutine BEGIN: called CC=1 SCAR=0.0
42  
43 sub new {
44 4 ▶ my ($class, @opts) = @_;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
45  
46 4 return $class->SUPER::new( @opts, type => 'pong' );
47 }
48  
49 2 1;
« WebSocket/Frame/ping.pm ↑ Summary WebSocket/Base/DataMessage.pm »