GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
POE::Component::Client::Whois(3) User Contributed Perl Documentation POE::Component::Client::Whois(3)

POE::Component::Client::Whois - A one shot non-blocking RFC 812 WHOIS query.

version 1.38

   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] );
   }

POE::Component::Client::Whois provides a lightweight one shot non-blocking RFC 812 WHOIS query to other POE sessions and components. The component will attempt to guess the appropriate whois server to connect to based on the query string passed.

If no guess can be made it will connect to whois.internic.net for domains, whois.arin.net for IPv4 addresses and whois.6bone.net for IPv6 addresses.

"whois"
Creates a POE::Component::Client::Whois session. Takes two mandatory arguments and a number of optional:

  '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;
  'host', the whois server to query; # Automagically determined by the component
  'referral', indicates to the poco whether to follow ReferralServer; # Default is 1
  'referral_only', indicates whether the poco should only return the results of querying
                   the referral server; # default is 0
    

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.

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:

  'reply', 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;

No parsing is undertaken on the returned data, this is an exercise left to the reader >;]

ketas, for first suggesting this module; buu, decay and hazard from #perl @ freenode, for helpful suggestions;

This module is based on the linux whois client from <http://www.linux.it/~md/software/>.

RFC 812 <http://www.faqs.org/rfcs/rfc812.html>.

Chris Williams <chris@bingosnet.co.uk>

This software is copyright (c) 2020 by Chris Williams.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2020-07-15 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.