This is automatically generated documentation. Edit after the "COMMENTS" heading; changes to the main body will be lost.

DriverManager Element Documentation


DriverManager -- Click element; a Script that manages driver stop events



Ports: any number of inputs, any number of outputs
Package: standard (core)


DriverManager is simply a Script element whose default TYPE is "DRIVER". Click driver stop events suggest that the driver should stop processing. Any element can register a driver stop event; for instance, trace processing elements can stop the driver when they finish a trace file. You generally request this functionality by supplying a 'STOP true' keyword argument. Driver stop events normally stop the driver: the user-level driver calls exit(0), or the kernel driver kills the relevant kernel threads. The DriverManager element changes this behavior. When a driver stop event occurs, the router steps through the DriverManager's script by calling its step handler. The driver exits only when the script ends or a stop instruction is executed. For example, the following DriverManager element ensures that an element, k, has time to clean itself up before the driver is stopped. It waits for the first driver stop event, then calls k's cleanup handler, waits for a tenth of a second, and stops the driver.

  DriverManager(pause, write k.cleanup, wait 0.1s, stop);

Use this idiom when one of your elements must emit a last packet or two before the router configuration is destroyed.



Generated by 'click-elem2man' from '../elements/standard/drivermanager.hh' on 28/Feb/2010.


elements/drivermanager.txt · Last modified: 2010/02/28 13:58 (external edit)
Recent changes RSS feed Driven by DokuWiki