|
NAMEAnyEvent::WebSocket::Message - WebSocket message for AnyEventVERSIONversion 0.44SYNOPSIS$connection->send( AnyEvent::WebSocket::Message->new(body => "some message"), ); $connection->on(each_message => sub { my($connection, $message) = @_; if($message->is_text || $message->is_binary) { my $body = $message->body; } }); DESCRIPTIONInstances of this class represent a single WebSocket message. They are the objects that come through from the other end of your AnyEvent::WebSocket::Connection instance. They can also be sent through that class using its "send" method.ATTRIBUTESbodyThe body or payload of the message.opcodeThe integer code for the type of message.METHODSdecoded_bodymy $body = $message->decoded_body; Returns the body decoded from UTF-8. is_textmy $bool = $message->is_text; True if the message is text. is_binarymy $bool = $message->is_binary; True if the message is binary. is_closemy $bool = $message->is_close; True if the message is a close message. is_pingmy $bool = $message->is_ping True if the message is a ping. is_pongmy $bool = $message->is_pong; True if the message is a pong. SEE ALSO
AUTHORAuthor: Graham Ollis <plicease@cpan.org>Contributors: Toshio Ito (debug-ito, TOSHIOITO) José Joaquín Atria (JJATRIA) Kivanc Yazan (KYZN) Yanick Champoux (YANICK) COPYRIGHT AND LICENSEThis software is copyright (c) 2013 by Graham Ollis.This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Visit the GSP FreeBSD Man Page Interface. |