Net::WebSocket::PMCE::deflate::Data::Streamer
my $streamer = $deflate_data->create_streamer( $frame_class ); #These frames form a single compressed message in three #fragments whose content is “onetwothree”. my @frames = ( $streamer->create_chunk('one'), $streamer->create_chunk('two'), $streamer->create_final('three'), );
This class implements fragmentation for the permessage-deflate WebSocket extension. It allows you to send a single message in arbitrarily many parts. The class is not instantiated directly, but instances are returned as the result of Net::WebSocket::PMCE::deflate::Data’s create_streamer() method.
create_streamer()
Strictly speaking, this is a base class; the ::Client and ::Server subclasses implement a bit of logic specific to either endpoint type.
::Client
::Server
The create_chunk() and create_final() methods follow the same pattern as Net::WebSocket::Streamer.
create_chunk()
create_final()
Compresses OCTET_STRING. The compressor doesn’t necessarily produce output from this, however. If the compressor does produce output, then this method returns a frame object (an instance of either the streamer’s assigned frame class or Net::WebSocket::Frame::continuation); otherwise, undef is returned.
Compresses OCTET_STRING and flushes the compressor. The output matches that of create_chunk() except that the output is always a frame object. The output of this method will complete the message.
To install Net::WebSocket, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::WebSocket
CPAN shell
perl -MCPAN -e shell install Net::WebSocket
For more information on module installation, please visit the detailed CPAN module installation guide.