Skip to content

Instantly share code, notes, and snippets.

@nrh
Created December 22, 2010 19:31
Show Gist options
  • Save nrh/751972 to your computer and use it in GitHub Desktop.
Save nrh/751972 to your computer and use it in GitHub Desktop.
tcp_connect 'localhost','18121', sub {
my ($fh) = @_;
sleep 10;
my $res;
ok( defined @_, "connect" );
ok( write($fh, "ruok\n"), "send ruok ". int($!) );
ok( read($fh, $res, 4), "recv ruok". int($!) );
print Dumper [ $!, $res ];
chomp($res);
ok($res eq "imok", "imok");
$cv->send(1);
};
ok($cv->recv(), "cv recv");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment