| 1 | package AnyEvent::Ident; | ||||||||||||
| 2 | |||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 2 | ▶ | use Exporter (); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | 2 | our @ISA = qw( Exporter ); | |||||||||||
| 8 | 2 | our @EXPORT_OK = qw( ident_server ident_client ); | |||||||||||
| 9 | |||||||||||||
| 10 | # ABSTRACT: Simple asynchronous ident client and server | ||||||||||||
| 11 | 2 | our $VERSION = '0.08'; # VERSION | |||||||||||
| 12 | |||||||||||||
| 13 | |||||||||||||
| 14 | # keep the server object in scope so that | ||||||||||||
| 15 | # we don't unbind from the port. If you | ||||||||||||
| 16 | # don't want this, then use the OO interface | ||||||||||||
| 17 | # for ::Server instead. | ||||||||||||
| 18 | 2 | my $keep = []; | |||||||||||
| 19 | |||||||||||||
| 20 | sub ident_server ($$$;$) | ||||||||||||
| 21 | 1 | ▶ | { | ||||||||||
|
Subroutine
ident_server: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||
| 22 | 1 | my $hostname = shift; | |||||||||||
| 23 | 1 | my $port = shift; | |||||||||||
| 24 | 1 | my $cb = shift; | |||||||||||
| 25 | 1 | require AnyEvent::Ident::Server; | |||||||||||
| 26 | my $server = AnyEvent::Ident::Server | ||||||||||||
| 27 | 1 | ▶ | ->new( hostname => $hostname, port => $port, %{ $_[0] || {} } ) | ||||||||||
|
Condition50%1/2
$_[0] || {}
MC/DC0%0/1
$_[0] || {}
$_[0]
Truth table50%1/2
A
A= $_[0]
| |||||||||||||
| 28 | ->start($cb); | ||||||||||||
| 29 | 1 | push @$keep, $server; | |||||||||||
| 30 | 1 | return $server; | |||||||||||
| 31 | } | ||||||||||||
| 32 | |||||||||||||
| 33 | |||||||||||||
| 34 | sub ident_client ($$$$$) | ||||||||||||
| 35 | 3 | ▶ | { | ||||||||||
|
Subroutine
ident_client: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 36 | 3 | my $hostname = shift; | |||||||||||
| 37 | 3 | my $port = shift; | |||||||||||
| 38 | 3 | require AnyEvent::Ident::Client; | |||||||||||
| 39 | 3 | AnyEvent::Ident::Client | |||||||||||
| 40 | ->new( hostname => $hostname, port => $port ) | ||||||||||||
| 41 | ->ident(@_); | ||||||||||||
| 42 | } | ||||||||||||
| 43 | |||||||||||||
| 44 | |||||||||||||
| 45 | 2 | 1; | |||||||||||
| 46 | |||||||||||||
| 47 | __END__ | ||||||||||||