GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NET::ANALYSIS::DISPATCHER (3)

.ds Aq ’

NAME

Net::Analysis::Dispatcher - handle the event stuff for the proto analysers

CONTENTS

SYNOPSIS



  use Net::Analysis::Dispatcher;

  my $d = Net::Analysis::Dispatcher->new();
  my $listener = Net::Analysis::Listener::TCP->new();
  $d->add_listener (listener => $listener);



DESCRIPTION

This class is used to register listener objects. Whenever any of the objects emit an event, the dispatcher is used to make sure other interested listeners receive the event.

    new ()

Takes no arguments, tells no lies.

add_listener (listener => CW$obj, config => CW$hash)

This method adds a new listener to the list of things to be notified of each event.

If the listener object has a field pos, then we attempt to put the listener in that position in the event queue. Valid values are first and last, to receive events first and last. Listener::TCP likes to be first, since it adds extra info to the tcp_packet that other modules might like to see.

If a listener has already claimed the first or last spot, then we croak with an error.

emit_event (name => ’event_name’, args => CW$hash)

The name must be a valid Perl function name. By convention, it should start with the name of the module that is emitting the event (e.g. http_transaction).

Where your code is emitting events, it must must document the args in detail, so that listeners will know what to do with them.

This method runs through the listener list, and if appropriate, invokes the listening method for each listener.

A listener gets the event if it has a method which has the same name as the event_name.

    EXPORT

None by default.

SEE ALSO

Net::Analysis::Listener::Base

AUTHOR

Adam B. Worrall, <adam@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2004 by Adam B. Worrall

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.

emit_event (name => ’event_name’, args => CW$hash)

The name must be a valid Perl function name. By convention, it should start with the name of the module that is emitting the event (e.g. http_transaction).

Where your code is emitting events, it must must document the args in detail, so that listeners will know what to do with them.

This method runs through the listener list, and if appropriate, invokes the listening method for each listener.

A listener gets the event if it has a method which has the same name as the event_name.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NET::ANALYSIS::DISPATCHER (3) 2010-03-31

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.