AnyEven...Message(3)
π AnyEvent::WebSocket::Message β WebSocket message for AnyEvent π
okay so bestie, the page header says AnyEven...Message(3) and it lives on the User Contributed Perl Documentation shelf. The actual main character is AnyEvent::WebSocket::Message, and we're about to go through every single detail together, no cap. π«Ά
π NAME π
AnyEvent::WebSocket::Message β WebSocket message for AnyEvent. That's the name and the whole assignment, periodt. π
β¨ VERSION β¨
version 0.55 β yes, that exact version, don't @ me. β¨
πΈ SYNOPSIS πΈ
okay so here's the whole send-and-receive situation in code, copied exactly:
$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're literally the objects that come through from the other end of your AnyEvent::WebSocket::Connection instance. You can also send them through that class using its send method. It's giving message-object main character energy, fr fr. π¦
π¦ ATTRIBUTES π¦
body
The body or payload of the message. That's the snack inside the envelope. π
opcode
The integer code for the type of message. It's the little number that says what kind of message this is. π₯
π METHODS π
decoded_body
my $body = $message->decoded_body;
Returns the body decoded from UTF-8. So you get the decoded body back, slay. β¨
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 π
AnyEvent::WebSocket::ClientAnyEvent::WebSocket::ConnectionAnyEvent::WebSocket::ServerAnyEventRFC 6455 The WebSocket Protocol <http://tools.ietf.org/html/rfc6455>
π AUTHOR π
Author: Graham Ollis <plicease@cpan.org>
Contributors:
Toshio Ito (debug-ito, TOSHIOITO)JosΓ© JoaquΓn Atria (JJATRIA)Kivanc Yazan (KYZN)Yanick Champoux (YANICK)Fayland Lam (FAYLAND)Daniel Kamil Kozar (xavery)
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2013-2022 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.
β¨ cute sign-off: this page was served with perl v5.42.0, dated 2023-05-05, and the footer header is AnyEven...Message(3). byeee bestie, go slay those WebSocket messages π
π
π¦ where this page comes from
- opensuse-leap 16.0: perl-AnyEvent-WebSocket-Client 0.55-bp160.1.11 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms