The NetWare event system provides a mechanism for monitoring server activities. The event system generates events for local activities such as volumes mounting or dismounting, connections logging in or logging out, eDirectory objects being added, deleted, or modified, and an NLMâ„¢ being loaded or unloaded. See Event Types for a list of the events and the data types they use.
A monitoring application can decide which events it wants to monitor and then register for these events. For most events, you can decide whether to be notified before the event occurs (which uses a Warn Routine), after the event occurs (which uses a Report Routine), or both before and after. However, the type of routine must correlate with the event type. For example, if your application registers a Report Routine for the server down event, your application's routine is never called because your application is unloaded in the server down process. For a server down event, you should register for a Warn Routine, which is called before the event.
Thus, when designing your notification routine, you need to make decisions about the following:
Type, warn or report. All events permit Report Routines, but not all events allow Warn Routines. For example, the EVENT_ANY_VOL_MOUNT event only allows for Report Routines.
Sleep. Because NetWare is a non-preemptive OS, you must decide whether you should yield the CPU during your notification routine. You can always yield in a Warn Routine. Some events prohibit sleep in a Report Routine. Even if an event allows sleep, be aware that the OS scheduler can ignore a sleep request.
Returned data. Both warn and report routines have a parm parameter that returns event data. For some events, the data is undefined and unusable by another application. For other events, the data is usable. For example, the EVENT_ANY_VOL_MOUNT event returns the volume number in the parm parameter.
User parm. Both warn and report routines have a userParm parameter. This optional parameter is for your use, and its contents are passed to you without modification.If your application registers for multiple events, you might use it as an index into your registered events.
An application remains registered for an event until the application requests that its event handler be removed (unregistered).
You use the following functions to interact the NetWare event system.