line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# You may distribute under the terms of either the GNU General Public License |
2
|
|
|
|
|
|
|
# or the Artistic License (the same terms as Perl itself) |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# (C) Paul Evans, 2017 -- leonerd@leonerd.org.uk |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Net::Async::WebSocket::JSON; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
561
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
22
|
|
9
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
41
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
C - use JSON-encoded data over WebSockets with C |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 DESCRIPTION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
This distribution provides subclasses of modules from L |
20
|
|
|
|
|
|
|
that add convenient wrappers for encoding or decoding JSON data in text frames |
21
|
|
|
|
|
|
|
over websockets. |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
To implement a server, use L as if it was |
24
|
|
|
|
|
|
|
L. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
To implement a client, use L as if it was |
27
|
|
|
|
|
|
|
L. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
In either cases, connected client instances will be instances of |
30
|
|
|
|
|
|
|
L, and have the new C method |
31
|
|
|
|
|
|
|
and C event available. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
This module itself does not provide any code, and exists only to provide the |
34
|
|
|
|
|
|
|
module C<$VERSION> and top-level documentation. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=cut |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 SEE ALSO |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=over 8 |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=item * |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
L - WebSocket protocol |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=back |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 AUTHOR |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Paul Evans |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
0x55AA; |