Apache-Hadoop-Watcher

 view release on metacpan or  search on metacpan

lib/Apache/Hadoop/Watcher/Base.pm  view on Meta::CPAN

sub _wget {
    my ($self, %opts) = (@_);
    my $content;
    my $res;
    my $ua;

    $ua  = LWP::UserAgent->new;
    $res = $ua->get ( $opts{'url'} );
    return 'error' unless $res->is_success;

    $content = $res->decoded_content;
    return $content;
}

sub _port {
    my (%opts) = (@_);
    my $socket = IO::Socket::INET->new(
        Proto=>'tcp',
        PeerAddr=>$opts{'host'} || '0.0.0.0',
        PeerPort=>$opts{'port'} || 0
        ) || undef;



( run in 0.433 second using v1.01-cache-2.11-cpan-26ccb49234f )