Net::WebSocket::Frame::pong
my $frm = Net::WebSocket::Frame::pong->new( #Optional, can be either empty (default) or four random bytes mask => q<>, payload => $payload, ); $frm->get_type(); #"ping" $frm->is_control(); #1 my $mask = $frm->get_mask_bytes(); my $payload = $frm->get_payload(); my $serialized = $frm->to_bytes();
Note that, as per RFC 6455, pong messages can have only up to 125 bytes in their payload.
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.