/usr/share/perl5/MR/IProto/Connection.pm is in libmr-tarantool-perl 0.0.24-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | package MR::IProto::Connection;
=head1 NAME
MR::IProto::Connection - base communication class
=head1 DESCRIPTION
Base class for sync and async connections.
=cut
use Mouse;
=head1 server
=over
=item server
Instanse of L<MR::IProto::Cluster::Server>.
=cut
has server => (
is => 'ro',
isa => 'MR::IProto::Cluster::Server',
required => 1,
weak_ref => 1,
handles => [qw(
host
port
connect_timeout
timeout
tcp_nodelay
tcp_keepalive
max_parallel
_send_started
_recv_finished
_debug
_debug_dump
)],
);
=back
=cut
sub _pack_header {
my ($self, $msg, $length, $sync) = @_;
return pack 'L3', $msg, $length, $sync;
}
sub _unpack_header {
my ($self, $header) = @_;
return unpack 'L3', $header;
}
sub _choose_sync {
my ($self) = @_;
return 1 + int rand 0xfffffffe;
}
no Mouse;
__PACKAGE__->meta->make_immutable();
1;
|