Graham Ollis


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


version 0.06


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


The constructor takes the following optional arguments:

  • hostname (default

    The hostname to connect to.

  • port (default 113)

    The port to connect to.

  • on_error (default carp error)

    A callback subref to be called on error (either connection or transmission error). Passes the error string as the first argument to the callback.

  • response_class (default AnyEvent::Ident::Response)

    Bless the response object into the given class. This class SHOULD inherit from AnyEvent::Ident::Response, or at least mimic its interface. This allows you to define your own methods for the response class.


$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.


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


Graham Ollis <>


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.