GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  PROTOCOL::WEBSOCKET::FRAME (3)

.ds Aq ’

NAME

Protocol::WebSocket::Frame - WebSocket Frame

CONTENTS

SYNOPSIS



    # Create frame
    my $frame = Protocol::WebSocket::Frame->new(123);
    $frame->to_bytes;

    # Parse frames
    my $frame = Protocol::WebSocket::Frame->new;
    $frame->append(...);
    $f->next; # get next message
    $f->next; # get another next message



DESCRIPTION

Construct or parse a WebSocket frame.

RANDOM MASK GENERATION

By default built-in rand is used, this is not secure, so when Math::Random::Secure is installed it is used instead.

ATTRIBUTES

CWtype

Frame’s type. text by default. Other accepted values:



    binary
    ping
    pong
    close



METHODS

CWnew



    Protocol::WebSocket::Frame->new(data);
    Protocol::WebSocket::Frame->new(buffer => data, type => close);



Create a new Protocol::WebSocket::Frame instance. Automatically detect if the passed data is a Perl string or bytes.

CWis_text

Check if frame is of text type.

CWis_binary

Check if frame is of binary type.

CWis_ping

Check if frame is a ping request.

CWis_pong

Check if frame is a pong response.

CWis_close

Check if frame is of close type.

CWappend



    $frame->append(...);



Append a frame chunk.

CWnext



    $frame->append(...);

    $frame->next; # next message



Return the next message as a Perl string.

CWnext_bytes

Return the next message as a UTF-8 encoded string.

CWto_bytes

Construct a WebSocket message as a UTF-8 encoded string.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 PROTOCOL::WEBSOCKET::FRAME (3) 2011-09-20

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.