AnyEvent-MySQL
view release on metacpan or search on metacpan
lib/AnyEvent/MySQL/Imp.pm view on Meta::CPAN
recv_packet($hd, sub {
if( substr($_[0], 0, 1) eq "\xFE" ) {
$cb->();
}
else {
skip_until_eof($hd, $cb);
}
});
}
=head2 send_packet($hd, $packet_num, $packet_frag1, $pack_frag2, ...)
=cut
sub send_packet {
return if !$_[0];
local $_[0] = $_[0];
my $len = reduce { $a + length($b) } 0, @_[2..$#_];
$_[0]->push_write(substr(pack('V', $len), 0, 3) . chr($_[1]) . join('', @_[2..$#_]));
}
=head2 _recv_field($hd, \@field)
=cut
( run in 1.856 second using v1.01-cache-2.11-cpan-b16cb0d3907 )