GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
AnyEvent::WebSocket::Message(3) User Contributed Perl Documentation AnyEvent::WebSocket::Message(3)

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

version 0.44

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

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.

The body or payload of the message.

The integer code for the type of message.

 my $body = $message->decoded_body;

Returns the body decoded from UTF-8.

 my $bool = $message->is_text;

True if the message is text.

 my $bool = $message->is_binary;

True if the message is binary.

 my $bool = $message->is_close;

True if the message is a close message.

 my $bool = $message->is_ping

True if the message is a ping.

 my $bool = $message->is_pong;

True if the message is a pong.

  • AnyEvent::WebSocket::Client
  • AnyEvent::WebSocket::Connection
  • AnyEvent::WebSocket::Server
  • AnyEvent
  • RFC 6455 The WebSocket Protocol <http://tools.ietf.org/html/rfc6455>

Author: Graham Ollis <plicease@cpan.org>

Contributors:

Toshio Ito (debug-ito, TOSHIOITO)

José Joaquín Atria (JJATRIA)

Kivanc Yazan (KYZN)

Yanick Champoux (YANICK)

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.

2017-12-12 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.