… | |
… | |
379 | |
379 | |
380 | $msg =~ s/\n$//; |
380 | $msg =~ s/\n$//; |
381 | $self->error ("login failed: $msg"); |
381 | $self->error ("login failed: $msg"); |
382 | } |
382 | } |
383 | |
383 | |
|
|
384 | sub on_event_notify { |
|
|
385 | my ($self, $event, @args) = @_; |
|
|
386 | |
|
|
387 | call $self, "on_${event}_event", @args; |
|
|
388 | } |
|
|
389 | |
384 | =back |
390 | =back |
385 | |
391 | |
386 | =head2 EVENTS |
392 | =head2 EVENTS |
387 | |
393 | |
388 | AnyEvent::Porttracker conenctions are fully event-driven, and naturally |
394 | AnyEvent::Porttracker conenctions are fully event-driven, and naturally |
… | |
… | |
460 | |
466 | |
461 | Called when the server wants to start TLS negotiation. This is used |
467 | Called when the server wants to start TLS negotiation. This is used |
462 | internally and - while it is possible to override it - should not be |
468 | internally and - while it is possible to override it - should not be |
463 | overriden. |
469 | overriden. |
464 | |
470 | |
|
|
471 | =item on_event_notify $api, $eventname, @args |
|
|
472 | |
|
|
473 | Called when the server broadcasts an event the API object is subscribed |
|
|
474 | to. The default implementation (which should not be overridden) simply |
|
|
475 | re-issues an "on_evenname_event" event with the @args. |
|
|
476 | |
465 | =item on_XYZ_notify $api, ... |
477 | =item on_XYZ_notify $api, ... |
466 | |
478 | |
467 | In general, any protocol notification will result in an event of the form |
479 | In general, any protocol notification will result in an event of the form |
468 | C<on_NOTIFICATION_notify>. |
480 | C<on_NOTIFICATION_notify>. |
469 | |
481 | |
|
|
482 | =item on_XYZ_event $api, ... |
|
|
483 | |
|
|
484 | Called when the server broadcasts the named (XYZ) event. |
|
|
485 | |
470 | =back |
486 | =back |
471 | |
487 | |
472 | =head1 SEE ALSO |
488 | =head1 SEE ALSO |
473 | |
489 | |
474 | L<AnyEvent>, L<http://www.porttracker.com/>, L<http://www.infoblox.com/en/products/portiq.html>. |
490 | L<AnyEvent>, L<http://www.porttracker.com/>, L<http://www.infoblox.com/en/products/portiq.html>. |