line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Perl wrapper around Wslay websocket library |
2
|
|
|
|
|
|
|
package Net::WebSocket::EVx; |
3
|
1
|
|
|
1
|
|
132026
|
use strict; use warnings; |
|
1
|
|
|
1
|
|
3
|
|
|
1
|
|
|
|
|
33
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
29
|
|
4
|
1
|
|
|
1
|
|
1067
|
use EV (); |
|
1
|
|
|
|
|
2665
|
|
|
1
|
|
|
|
|
26
|
|
5
|
1
|
|
|
1
|
|
7
|
use XSLoader (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
45
|
|
6
|
|
|
|
|
|
|
our $VERSION; |
7
|
|
|
|
|
|
|
BEGIN { |
8
|
1
|
|
|
1
|
|
4
|
$VERSION = '0.18'; |
9
|
1
|
|
|
|
|
569
|
XSLoader::load(__PACKAGE__, $VERSION); |
10
|
|
|
|
|
|
|
} |
11
|
1
|
|
|
1
|
|
9
|
use constant { WS_FRAGMENTED_EOF => 0, WS_FRAGMENTED_ERROR => -1, WS_FRAGMENTED_DATA => 1 }; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
140
|
|
12
|
1
|
|
|
1
|
|
6
|
use Exporter 'import'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
255
|
|
13
|
|
|
|
|
|
|
our @EXPORT = qw/WS_FRAGMENTED_EOF WS_FRAGMENTED_ERROR WS_FRAGMENTED_NODATA/; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new { |
16
|
2
|
|
|
2
|
1
|
3298
|
my (undef, $self) = @_; |
17
|
2
|
100
|
|
|
|
10
|
$self->{buffering} = 1 unless defined $self->{buffering}; |
18
|
2
|
100
|
|
|
|
9
|
$self->{type} = 'server' unless defined $self->{type}; |
19
|
|
|
|
|
|
|
_wslay_event_context_init( |
20
|
|
|
|
|
|
|
$self, |
21
|
|
|
|
|
|
|
(defined($self->{fd}) && $self->{fd} || fileno($self->{fh})), |
22
|
2
|
|
33
|
|
|
75
|
int($self->{type} eq 'server') |
23
|
|
|
|
|
|
|
); |
24
|
2
|
|
|
|
|
14
|
_wslay_event_config_set_no_buffering($self, int(!$self->{buffering})); |
25
|
2
|
50
|
|
|
|
6
|
_wslay_event_config_set_max_recv_msg_length($self, $self->{max_recv_size}) if defined $self->{max_recv_size}; |
26
|
2
|
|
|
|
|
34
|
bless $self |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
0
|
0
|
|
0
|
1
|
|
sub wait { if ($_[1]) { $_[0]->_set_waiter($_[1]) } } |
|
0
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |