AnyEvent-Ident

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

{
   "abstract" : "Simple asynchronous ident client and server",
   "author" : [
      "Graham Ollis <plicease@cpan.org>"
   ],
   "dynamic_config" : 0,
   "generated_by" : "Dist::Zilla version 6.014, CPAN::Meta::Converter version 2.150010",
   "license" : [
      "perl_5"
   ],
   "meta-spec" : {
      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",

META.yml  view on Meta::CPAN

---
abstract: 'Simple asynchronous ident client and server'
author:
  - 'Graham Ollis <plicease@cpan.org>'
build_requires:
  Test::More: '0.98'
  perl: '5.006'
configure_requires:
  ExtUtils::MakeMaker: '0'
  perl: '5.006'
dynamic_config: 0
generated_by: 'Dist::Zilla version 6.014, CPAN::Meta::Converter version 2.150010'

Makefile.PL  view on Meta::CPAN

}
# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.014.
use strict;
use warnings;

use 5.006;

use ExtUtils::MakeMaker;

my %WriteMakefileArgs = (
  "ABSTRACT" => "Simple asynchronous ident client and server",
  "AUTHOR" => "Graham Ollis <plicease\@cpan.org>",
  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => 0
  },
  "DISTNAME" => "AnyEvent-Ident",
  "LICENSE" => "perl",
  "MIN_PERL_VERSION" => "5.006",
  "NAME" => "AnyEvent::Ident",
  "PREREQ_PM" => {
    "AnyEvent" => 0

README  view on Meta::CPAN

NAME

    AnyEvent::Ident - Simple asynchronous ident client and server

VERSION

    version 0.08

SYNOPSIS

    client:

     use AnyEvent::Ident qw( ident_client );

lib/AnyEvent/Ident.pm  view on Meta::CPAN

package AnyEvent::Ident;

use strict;
use warnings;
use Exporter ();

our @ISA = qw( Exporter );
our @EXPORT_OK = qw( ident_server ident_client );

# ABSTRACT: Simple asynchronous ident client and server
our $VERSION = '0.08'; # VERSION


# keep the server object in scope so that
# we don't unbind from the port.  If you 
# don't want this, then use the OO interface
# for ::Server instead.
my $keep = [];

sub ident_server ($$$;$)

lib/AnyEvent/Ident.pm  view on Meta::CPAN

1;

__END__

=pod

=encoding UTF-8

=head1 NAME

AnyEvent::Ident - Simple asynchronous ident client and server

=head1 VERSION

version 0.08

=head1 SYNOPSIS

client:

 use AnyEvent::Ident qw( ident_client );

lib/AnyEvent/Ident/Client.pm  view on Meta::CPAN

package AnyEvent::Ident::Client;

use strict;
use warnings;
use AnyEvent::Socket qw( tcp_connect );
use AnyEvent::Handle;
use Carp qw( carp );

# ABSTRACT: Simple asynchronous ident client
our $VERSION = '0.08'; # VERSION


sub new
{
  my $class = shift;
  my $args     = ref $_[0] eq 'HASH' ? (\%{$_[0]}) : ({@_});
  my $port = $args->{port};
  $port = 113 unless defined $port;
  bless { 

lib/AnyEvent/Ident/Client.pm  view on Meta::CPAN

1;

__END__

=pod

=encoding UTF-8

=head1 NAME

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

=head1 VERSION

version 0.08

=head1 SYNOPSIS

 use AnyEvent::Ident::Client;
 
 my $client = AnyEvent::Ident::Client->new( hostname => 127.0.0.1' );

lib/AnyEvent/Ident/Request.pm  view on Meta::CPAN

package AnyEvent::Ident::Request;

use strict;
use warnings;
use Carp qw( croak );

# ABSTRACT: Simple asynchronous ident response
our $VERSION = '0.08'; # VERSION

sub new
{
  my $class = shift;
  my $self = bless {}, $class;
  if(@_ == 1)
  {
    my $raw = $self->{raw} = shift;
    if($raw =~ /^\s*(\d+)\s*,\s*(\d+)\s*$/)

lib/AnyEvent/Ident/Request.pm  view on Meta::CPAN

1;

__END__

=pod

=encoding UTF-8

=head1 NAME

AnyEvent::Ident::Request - Simple asynchronous ident response

=head1 VERSION

version 0.08

=head1 ATTRIBUTES

=head2 as_string

 my $str = $res->as_string;

lib/AnyEvent/Ident/Response.pm  view on Meta::CPAN

package AnyEvent::Ident::Response;

use strict;
use warnings;

# ABSTRACT: Simple asynchronous ident response
our $VERSION = '0.08'; # VERSION

sub new
{
  my $class = shift;
  if(@_ == 1)
  {
    my $raw = shift;
    $raw =~ s/^\s+//;
    $raw =~ s/\s+$//;

lib/AnyEvent/Ident/Response.pm  view on Meta::CPAN

1;

__END__

=pod

=encoding UTF-8

=head1 NAME

AnyEvent::Ident::Response - Simple asynchronous ident response

=head1 VERSION

version 0.08

=head1 ATTRIBUTES

=head2 as_string

 my $str = $res->as_string

lib/AnyEvent/Ident/Server.pm  view on Meta::CPAN

use strict;
use warnings;
use AnyEvent;
use AnyEvent::Socket qw( tcp_server );
use AnyEvent::Handle;
use AnyEvent::Ident::Request;
use AnyEvent::Ident::Response;
use AnyEvent::Ident::Transaction;
use Carp qw( croak carp );

# ABSTRACT: Simple asynchronous ident server
our $VERSION = '0.08'; # VERSION


sub new
{
  my $class = shift;
  my $args  = ref $_[0] eq 'HASH' ? (\%{$_[0]}) : ({@_});
  my $port  = $args->{port};
  $port = 113 unless defined $port;
  bless {

lib/AnyEvent/Ident/Server.pm  view on Meta::CPAN

1;

__END__

=pod

=encoding UTF-8

=head1 NAME

AnyEvent::Ident::Server - Simple asynchronous ident server

=head1 VERSION

version 0.08

=head1 SYNOPSIS

 use AnyEvent::Ident::Server;
 my $server = AnyEvent::Ident::Server->new;
 

lib/AnyEvent/Ident/Server.pm  view on Meta::CPAN

     $tx->reply_with_user('UNIX', 'grimlock');
   }
   else
   {
     $tx->reply_with_error('NO-USER');
   }
 });

=head1 DESCRIPTION

Provide a simple asynchronous ident server.  This class manages 
connections and handles client errors for you, but you have to provide 
an implementation which determines the owner for a connection given a 
server and client port. This class may also be useful for testing ident 
clients against (see the test suite in this distribution, it uses this 
class to test L<AnyEvent::Ident::Client>), or for constructing an ident 
server which always returns the same user (which may be useful for some 
applications, such as IRC).

=head1 CONSTRUCTOR

lib/AnyEvent/Ident/Transaction.pm  view on Meta::CPAN

package AnyEvent::Ident::Transaction;

use strict;
use warnings;
use AnyEvent::Ident::Response;

# ABSTRACT: Simple asynchronous ident transaction
our $VERSION = '0.08'; # VERSION


sub req { shift->{req} }


sub reply_with_user
{
  my $self = shift;
  my $username = pop;

lib/AnyEvent/Ident/Transaction.pm  view on Meta::CPAN

1;

__END__

=pod

=encoding UTF-8

=head1 NAME

AnyEvent::Ident::Transaction - Simple asynchronous ident transaction

=head1 VERSION

version 0.08

=head1 METHODS

=head2 req

 my $req = $tx->req;



( run in 0.389 second using v1.01-cache-2.11-cpan-0d8aa00de5b )