AnyEvent-Radius

 view release on metacpan or  search on metacpan

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


=back

=head1 METHODS

=over

=item load_dictionary ($dictionary-file)

Class method to load dictionary - returns the object to be passed to constructor

=item send_packet ( $type, $av_list, $cb )

Builds RADIUS packet using L<Data::Radius::Packet> and store it to outgoing queue.

The type can be either the direct RFC packet type id, or one of its aliases,
like COA, DM, POD, ACCT, AUTH ... see C<Data::Radius::Constants>

Passing the optional callback $cb to be called upon receiving response to this request in form

  $cb->($resp_type, $resp_av_list)

or with empty parameters in case of missing response - eg. being timed out or unmatched authenticator

  $cb->()

Returns request id.
Note that it's not possible to schedule more than 255 requests - trying to add more will return undef

=item send_auth ($av_list, $cb)

=item send_acct ($av_list, $cb)

=item send_pod ($av_list, $cb)

=item send_coa ($av_list, $cb)

Alias methods to send RADIUS request of required type by L<send_packet()>

=item wait()

Blocks until all requests are received or read timeout reached,
new requests can't be sent afterwards until next call to C<init>

=item init( $initial_last_request_id )

Re-initilize the queue with optional last used request id

=item on_ready ( $cond_var )

Used to coordinate multiple clients instead of L<wait()>

Example:

    my $cv = AnyEvent->condvar;
    $client1->on_ready($cv);
    $client2->on_ready($cv);
    $client3->on_ready($cv);
    $cv->recv;

Will be blocked until all clients finish their queue.

=item destroy()

Destroy the internal socket handle. Must be called when object is no longer required.
When called from callback, it is recommended to wrap this call into AnyEvent::postpone { ... } block.

=back

=head1 SEE ALSO

L<Authen::Radius>, L<AnyEvent::Radius::Server>, L<Data::Radius>

=head1 AUTHOR

Sergey Leschenko <sergle.ua at gmail.com>

PortaOne Development Team <perl-radius at portaone.com> is the current module's maintainer at CPAN.

=cut



( run in 1.950 second using v1.01-cache-2.11-cpan-df04353d9ac )