Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
AnyEvent::WebSocket::MUsergContributed Perl DocAnyEvent::WebSocket::Message(3)

NAME
       AnyEvent::WebSocket::Message - WebSocket	message	for AnyEvent

VERSION
       version 0.44

SYNOPSIS
	$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;
	  }
	});

DESCRIPTION
       Instances 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.

ATTRIBUTES
   body
       The body	or payload of the message.

   opcode
       The integer code	for the	type of	message.

METHODS
   decoded_body
	my $body = $message->decoded_body;

       Returns the body	decoded	from UTF-8.

   is_text
	my $bool = $message->is_text;

       True if the message is text.

   is_binary
	my $bool = $message->is_binary;

       True if the message is binary.

   is_close
	my $bool = $message->is_close;

       True if the message is a	close message.

   is_ping
	my $bool = $message->is_ping

       True if the message is a	ping.

   is_pong
	my $bool = $message->is_pong;

       True if the message is a	pong.

SEE ALSO
       o   AnyEvent::WebSocket::Client

       o   AnyEvent::WebSocket::Connection

       o   AnyEvent::WebSocket::Server

       o   AnyEvent

       o   RFC 6455 The	WebSocket Protocol
	   <http://tools.ietf.org/html/rfc6455>

AUTHOR
       Author: Graham Ollis <plicease@cpan.org>

       Contributors:

       Toshio Ito (debug-ito, TOSHIOITO)

       JosA(C) JoaquAn Atria (JJATRIA)

       Kivanc Yazan (KYZN)

       Yanick Champoux (YANICK)

COPYRIGHT AND LICENSE
       This 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.

perl v5.32.0			  2017-12-12   AnyEvent::WebSocket::Message(3)

NAME | VERSION | SYNOPSIS | DESCRIPTION | ATTRIBUTES | METHODS | SEE ALSO | AUTHOR | COPYRIGHT AND LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=AnyEvent::WebSocket::Message&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help