ClickHouse-Encoder
view release on metacpan or search on metacpan
# read_packet's timeout. Without one the call blocks in sysread forever,
# which is what a handshake against a too-new server does: both sides
# wait and neither gives up. Verified against ClickHouse 26.7 (rev 54488),
# where the Hello succeeds and the very next read hangs.
SKIP: {
my $ok = eval { require IO::Socket::INET; 1 };
skip 'IO::Socket::INET not available', 3 unless $ok;
# A listening socket that accepts but never speaks, standing in for
# the deadlocked server.
my $srv = IO::Socket::INET->new(
LocalAddr => '127.0.0.1', LocalPort => 0,
Listen => 1, ReuseAddr => 1);
skip 'could not open a loopback listener', 3 unless $srv;
my $cli = IO::Socket::INET->new(
PeerAddr => '127.0.0.1', PeerPort => $srv->sockport, Timeout => 5);
skip 'could not connect to the loopback listener', 3 unless $cli;
my $acc = $srv->accept; # accepted, then deliberately ignored
binmode $cli;
( run in 2.474 seconds using v1.01-cache-2.11-cpan-800906f7e73 )