The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Protocol::WebSocket::XS::FrameSender - low-level frame generator helper

DESCRIPTION

The class helps in creation of low-level frames of a single message. It might be useful if message data is partly available and should be serialized and delivered to peer ASAP as a frame.

You cannot instantiate an object of the class direcly, it can be accessed only via Protocol::WebSocket::XS::Parser.

METHODS

send($string|\@strings, [$final = 0])

Returns serialized frame with the supplied payload (in form of string or array of strings).

Set $final to a true value for the last frame to finalize the message. In this case no further send() calls are allowed.

If deflate is enabled then send() may generate an empty frames (except for the last frame) due to output latency. final frame flushes all accumulated compressed payload.

SEE ALSO

Protocol::WebSocket::XS

Protocol::WebSocket::XS::FrameIterator

Protocol::WebSocket::XS::Message

Protocol::WebSocket::XS::Parser

rfc6455