Graham Ollis > AnyEvent-Ident > AnyEvent::Ident::Client

Download:
AnyEvent-Ident-0.06.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.06   Source  

NAME ^

AnyEvent::Ident::Client - Simple asynchronous ident client

VERSION ^

version 0.06

SYNOPSIS ^

 use AnyEvent::Ident::Client;
 
 my $client = AnyEvent::Ident::Client->new( hostname => 127.0.0.1' );
 $client->ident($server_port, $client_port, sub {
   my($res) = @_; # isa AnyEvent::Client::Response 
   if($res->is_success)
   {
     print "user: ", $res->username, "\n";
     print "os:   ", $res->os, "\n";
   }
   else
   {
     warn "Ident error: " $res->error_type;
   }
 });

CONSTRUCTOR ^

The constructor takes the following optional arguments:

METHODS ^

$client->ident( $server_port, $client_port, $callback )

Send an ident request to the ident server with the given TCP port pair. The callback will be called when the response is returned from the server. Its only argument will be an instance of AnyEvent::Ident::Response.

On the first call to this method, a connection to the ident server is opened, and will remain open until close (see below) is called, or if the $client object falls out of scope.

$client->close

Close the connection to the ident server. Requests that are in progress will receive an error response with the type UNKNOWN-ERROR.

AUTHOR ^

Graham Ollis <plicease@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2013 by Graham Ollis.

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

syntax highlighting: