NAME
POE::Component::Client::Whois - A one shot non-blocking WHOIS query.
SYNOPSIS
use strict;
use warnings;
use POE qw(Component::Client::Whois);
use Data::Dumper;
POE::Session->create(
package_states => [
'main' => [ qw(_start _response) ],
],
);
$poe_kernel->run();
exit 0;
sub _start {
my ($kernel,$heap) = @_[KERNEL,HEAP];
POE::Component::Client::Whois->whois( host => "whois.nic.uk",
query => 'bingosnet.co.uk',
event => '_response',
_arbitary => [ qw(moo moo moo) ] );
undef;
}
sub _response {
print STDERR Dumper( $_[ARG0] );
}
DESCRIPTION
POE::Component::Client::Whois provides a lightweight one shot non-blocking WHOIS query to other POE sessions and components.
CONSTRUCTOR
- whois
-
Creates a POE::Component::Client::Whois session. Takes three mandatory arguments and two optional:
'host', the whois server to query; # Mandatory 'query', the string query to send to the whois server; # Mandatory 'event', the event name to emit on success/failure; # Mandatory 'port', the port on the whois server to connect to, defaults to 43; 'session', a session or alias to send the above 'event' to, defaults to calling session;
One can also pass arbitary data to whois() which will be passed back in the response event. It is advised that one uses an underscore prefix to avoid clashes with future versions.
OUTPUT
ARG0 will be a hashref, which contains the original parameters passed to whois() ( including any arbitary data ), plus either one of the following two keys:
'response', an arrayref of response lines from the whois server, assuming no error occurred;
'error', in lieu of a valid response, this will be defined with a brief description of what went wrong;
AUTHOR
Chris "BinGOs" Williams <chris@bingosnet.co.uk>