ization::json;
use JSON ();
use constant {
serialization => 'json',
websocket_data_type => 'text',
};
#The following have trouble dealing with anything that isn’t UTF-8;
#but JSON must al
UTF-32 anyway as per RFC 7159.
#So, any application that wants to send binary data via JSON needs to use
#Base64, hex, or some such.
*stringify = *JSON::encode_json;
*parse = *JSON::decode_json;
1;
LENGTH => 2**23, #8 MiB
SERIALIZERS => [
undef,
'json',
'msgpack',
'cbor',
#'ubjson',
],
HANDSHAKE_ERR_1 => 'serializer unsupported',
HANDSHA
:Session->new(
#required
on_send => sub { ... },
#optional; default is 'json'
serialization => 'msgpack',
);
=head1 DISCUSSION
The only thing externally documen
#default
);
#msgpack is also accepted
$rs->send_handshake(
serialization => 'json', #default
);
$rs->verify_handshake();
$rs->send_message('This is a message.);
his when your read timeout expires to send a PING message.
=head2 I<OBJ>->get_serialization()
C<json> or C<msgpack>.
=head2 I<OBJ>->get_max_send_length()
The maximum bytes that the connection’s
------------------
package main;
my $client = My_Client->new(
serialization => 'json',
#Output this way:
on_send => sub {
my $serialized_bytes = shift;
t
layer (e.g., WebSocket, RawSocket, …) you’re using.
=item * C<serialization> (optional): C<json> is the default; C<msgpack>
is also an option.
=back
=head2 I<OBJ>->send_HELLO( REALM, AUXILIAR
speak raw TCP.
=head1 SERIALIZATIONS
WAMP defines two serializations officially: L<JSON|http://json.org>
(C<json>)
and L<MessagePack|http://msgpack.org> (C<msgpack>).
Note that MessagePack is a bi