NAME
Net::WebSocket::Frame::text
SYNOPSIS
NOTE: Before you instantiate this class directly, look at Net::WebSocket::Endpoint’s create_message()
convenience method to make your life easier.
my $frm = Net::WebSocket::Frame::text->new(
#This flag defaults to on
fin => 1,
#For servers, this must be empty (default).
#For clients, this must be four random bytes.
mask => q<>,
payload => $payload_text,
);
$frm->get_type(); #"text"
$frm->is_control(); #0
my $mask = $frm->get_mask_bytes();
my $payload = $frm->get_payload();
my $serialized = $frm->to_bytes();
$frm->set_fin(); #turns on