The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

ROADS::WPPC - A class to talk to WHOIS++ servers

SYNOPSIS

  use ROADS::WPPC;
  @results = wppc($host, $port, $request);
  foreach $I (@results) { print $I, ": ", $TEMPLATE{$I}, "\n"; }

DESCRIPTION

This class implements a simple WHOIS++ client which returns raw WHOIS++ responses in a hash array with global scope, together with an index of matching templates and server handles.

METHODS

wppc( host, port, request );

Invoking this method causes the following to happen :-

A TCP connection is made to port port on the machine whose Internet address or domain name is host.
The request request is sent.
We sit and wait for responses to come back.
For each template which comes back from the remote server, we record its details (server handle and local handle) as an entry in a scalar array which is returned when we reach the end of the responses and drop out of wppc.

DATA FORMATS

The format of the per-template information returned by wppc will be one of the following :-

serverhandle:handle - if the response is a simple template. serverhandle:referral - if the response is a referral. localcount:NN - if the response is a COUNT template containing hit count information. referralcount:NN - if the reponse is a COUNT template containing hit count information. noconnect - if the server couldn't be contacted.

The format of the individual templates, as indexed by the serverhandle:handle notation, is as they appear on the wire when send from the WHOIS++ server back to the client. This means that any code which processes them will need to do some extra work to get at individual fields in the templates. This will change in a future version of the ROADS software.

Here's a sample on-the-wire WHOIS++ record :-

  # FULL DOCUMENT MULTICS xdom01
   Title: cross domain search test
   Description: this is really just a test
   URI: http://www.roads.lut.ac.uk/
  # END

Note that it will not include the variant suffixes, since these are generally not used in WHOIS++ implementations. Note also that the four fields on the first line of the record correspond to :-

format
template type
serverhandle
handle

FILES

config/multilingual/*/lib/toomanyhits.html - if the number of hits was so great that it exceeded a pre-defined administrative upper limit.

BUGS

We shouldn't be trying to do HTML rendering in this code. We also shouldn't be trying to return a list of templates (and other things - all mushed up together!) and also poking around in the shared global namespace at the same time. Searches and search results probably ought to be objects in their own right, with search results being comprized of metadata objects.

It would be neat if we could open connections to multiple servers and use select()/poll() to divide our time between them. Currently we're limited to contacting servers strictly in series :-(

SEE ALSO

"admin.pl" in admin-cgi, "lookupcluster.pl" in admin-cgi, "search.pl" in cgi-bin

COPYRIGHT

Copyright (c) 1988, Martin Hamilton <martinh@gnu.org> and Jon Knight <jon@net.lut.ac.uk>. All rights reserved.

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

It was developed by the Department of Computer Studies at Loughborough University of Technology, as part of the ROADS project. ROADS is funded under the UK Electronic Libraries Programme (eLib), the European Commission Telematics for Research Programme, and the TERENA development programme.

AUTHOR

Martin Hamilton <martinh@gnu.org>