| 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; | |