Skip to content

Instantly share code, notes, and snippets.

@benvanstaveren
Created January 15, 2014 20:35
Show Gist options
  • Save benvanstaveren/8444038 to your computer and use it in GitHub Desktop.
Save benvanstaveren/8444038 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use Mojo::IOLoop;
my ($ip, $port, $status);
Mojo::IOLoop->client({ port => $port, address => $ip } => sub {
my ($loop, $error, $stream) = (@_);
if(defined($error)) {
print 'KO', "\n";
} else {
print 'OK', "\n";
}
});
Mojo::IOLoop->start unless Mojo::IOLoop->is_running;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment