line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package # hide from CPAN |
2
|
|
|
|
|
|
|
Riemann::Client::Transport::UDP; |
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
14
|
use Moo; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
13
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
650
|
use Riemann::Client::Protocol; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
71
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
extends 'Riemann::Client::Transport'; |
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
11
|
use constant MAX_DTGRM_SIZE => 16384; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
363
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub send { |
13
|
0
|
|
|
0
|
0
|
|
my ($self, $msg) = @_; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# Encode the message |
16
|
0
|
|
|
|
|
|
my $encoded = Msg->encode($msg); |
17
|
|
|
|
|
|
|
|
18
|
0
|
0
|
|
|
|
|
if (length $encoded > MAX_DTGRM_SIZE) { |
19
|
0
|
|
|
|
|
|
die 'Message too long'; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# Write to the socket |
23
|
0
|
|
|
|
|
|
my $sock = $self->socket; |
24
|
0
|
0
|
|
|
|
|
$sock->send($encoded) or die $!; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |