line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: Message.pm,v 1.9 2014-01-28 15:40:10 joern Exp $ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
#----------------------------------------------------------------------- |
4
|
|
|
|
|
|
|
# Copyright (C) 2002-2015 by Jörn Reder . |
5
|
|
|
|
|
|
|
# All Rights Reserved. See file COPYRIGHT for details. |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
# This module is part of Event::RPC, which is free software; you can |
8
|
|
|
|
|
|
|
# redistribute it and/or modify it under the same terms as Perl itself. |
9
|
|
|
|
|
|
|
#----------------------------------------------------------------------- |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
package Event::RPC::Message::JSON; |
12
|
|
|
|
|
|
|
|
13
|
18
|
|
|
18
|
|
93
|
use base Event::RPC::Message::SerialiserBase; |
|
18
|
|
|
|
|
24
|
|
|
18
|
|
|
|
|
1265
|
|
14
|
|
|
|
|
|
|
|
15
|
18
|
|
|
18
|
|
90
|
use strict; |
|
18
|
|
|
|
|
39
|
|
|
18
|
|
|
|
|
405
|
|
16
|
18
|
|
|
18
|
|
96
|
use utf8; |
|
18
|
|
|
|
|
46
|
|
|
18
|
|
|
|
|
106
|
|
17
|
|
|
|
|
|
|
|
18
|
18
|
|
|
18
|
|
563
|
use JSON::XS 3.0; |
|
18
|
|
|
|
|
507
|
|
|
18
|
|
|
|
|
3046
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $decoder = JSON::XS->new->allow_tags; |
21
|
|
|
|
|
|
|
my $encoder = JSON::XS->new->latin1->allow_blessed->allow_tags; |
22
|
|
|
|
|
|
|
|
23
|
156
|
|
|
156
|
0
|
10081
|
sub decode_message { $decoder->decode($_[1]) } |
24
|
156
|
|
|
156
|
0
|
7456
|
sub encode_message { $encoder->encode($_[1]) } |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |