.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "AnyEvent::WebSocket::Message 3pm" .TH AnyEvent::WebSocket::Message 3pm "2021-03-23" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" AnyEvent::WebSocket::Message \- WebSocket message for AnyEvent .SH "VERSION" .IX Header "VERSION" version 0.54 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& $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; \& } \& }); .Ve .SH "DESCRIPTION" .IX Header "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 \f(CW\*(C`send\*(C'\fR method. .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" .SS "body" .IX Subsection "body" The body or payload of the message. .SS "opcode" .IX Subsection "opcode" The integer code for the type of message. .SH "METHODS" .IX Header "METHODS" .SS "decoded_body" .IX Subsection "decoded_body" .Vb 1 \& my $body = $message\->decoded_body; .Ve .PP Returns the body decoded from \s-1UTF\-8.\s0 .SS "is_text" .IX Subsection "is_text" .Vb 1 \& my $bool = $message\->is_text; .Ve .PP True if the message is text. .SS "is_binary" .IX Subsection "is_binary" .Vb 1 \& my $bool = $message\->is_binary; .Ve .PP True if the message is binary. .SS "is_close" .IX Subsection "is_close" .Vb 1 \& my $bool = $message\->is_close; .Ve .PP True if the message is a close message. .SS "is_ping" .IX Subsection "is_ping" .Vb 1 \& my $bool = $message\->is_ping .Ve .PP True if the message is a ping. .SS "is_pong" .IX Subsection "is_pong" .Vb 1 \& my $bool = $message\->is_pong; .Ve .PP True if the message is a pong. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "\(bu" 4 AnyEvent::WebSocket::Client .IP "\(bu" 4 AnyEvent::WebSocket::Connection .IP "\(bu" 4 AnyEvent::WebSocket::Server .IP "\(bu" 4 AnyEvent .IP "\(bu" 4 \&\s-1RFC 6455\s0 The WebSocket Protocol .SH "AUTHOR" .IX Header "AUTHOR" Author: Graham Ollis .PP Contributors: .PP Toshio Ito (debug-ito, \s-1TOSHIOITO\s0) .PP José Joaquín Atria (\s-1JJATRIA\s0) .PP Kivanc Yazan (\s-1KYZN\s0) .PP Yanick Champoux (\s-1YANICK\s0) .PP Fayland Lam (\s-1FAYLAND\s0) .PP Daniel Kamil Kozar (xavery) .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2013 by Graham Ollis. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.