Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dispatcher(3i) [debian man page]

Dispatcher(3I)						    InterViews Reference Manual 					    Dispatcher(3I)

NAME
Dispatcher - wait on multiple file descriptors until a condition occurs SYNOPSIS
#include <Dispatch/dispatcher.h> DESCRIPTION
Conceptually, the dispatcher plays the role of detecting new data on multiple input file descriptors and dispatching the data to the appro- priate iohandlers. The dispatcher also notifies iohandlers of expired timers. Notification of either an I/O condition or an expired timer occurs by calling one of the iohandler's virtual functions (see IOHandler(3I)). Since a program needs only one instance of Dispatcher, a static member function is provided to create that instance if necessary and return it. PUBLIC OPERATIONS
enum DispatcherMask { ReadMask, WriteMask, ExceptMask } virtual IOHandler* handler(int fd, DispatcherMask) virtual void link(int fd, DispatcherMask, IOHandler*) virtual void unlink(int fd) Return a file descriptor's iohandler, link a file descriptor to an iohandler, or unlink a file descriptor from its iohandlers. The DispatcherMask describes the I/O condition that the iohandler is interested in, such as whether the file descriptor has new data available for reading. If the I/O condition occurs, the iohandler will be expected to read data from the file descriptor, write data to the file descriptor, or handle the exception depending on the I/O condition. virtual void startTimer(long sec, long usec, IOHandler*) virtual void stopTimer(IOHandler*) Attach an iohandler to a timer or remove a timer before it expires. A timer expires after the given number of seconds and microsec- onds have elapsed. If a timer expires, the dispatcher will notify the attached iohandler. Timers will not expire until the program calls either variant of Dispatcher::dispatch. virtual void dispatch() virtual boolean dispatch(long& sec, long& usec) With no arguments, block indefinitely until an I/O condition occurs or a timer expires and then notify the attached iohandler. With two arguments, block no longer than the given number of seconds and microseconds. If both numbers are zero, the function will return immediately after checking all file descriptors and timers. The return value will be true if an I/O condition caused the function to return and false if the function returned because a timer expired or it exceeded the given poll time. The function will decrease the given poll time by the amount of time it spent blocking. static Dispatcher& instance() static void instance(Dispatcher*) With no arguments, create an instance of Dispatcher if it doesn't already exist and return it. With an argument, set the instance of Dispatcher that will be used throughout the program. SEE ALSO
select(2), IOHandler(3I) InterViews 21 December 1990 Dispatcher(3I)

Check Out this Related Man Page

dat_evd_free(3DAT)				     Direct Access Transport Library Functions					dat_evd_free(3DAT)

NAME
dat_evd_free - destroy an instance of the Event Dispatcher SYNOPSIS
cc [ flag... ] file... -ldat [ library... ] #include <dat/udat.h> DAT_RETURN dat_evd_free ( IN DAT_EVD_HANDLE evd_handle ) PARAMETERS
evd_handle Handle for an instance of the Event Dispatcher. DESCRIPTION
The dat_evd_free() function destroys a specified instance of the Event Dispatcher. All events on the queue of the specified Event Dispatcher are lost. The destruction of the Event Dispatcher instance does not have any effect on any DAT Objects that originated an Event Stream that had fed events to the Event Dispatcher instance. There should be no event streams feeding the Event Dispatcher and no threads blocked on the Event Dispatcher when the EVD is being closed as at the time when it was created. Use of the handle of the destroyed Event Dispatcher in any consequent operation fails. RETURN VALUES
DAT_SUCCESS The operation was successful. DAT_INVALID_HANDLE The evd_handle parameter is invalid DAT_INVALID_STATE Invalid parameter. There are Event Streams associated with the Event Dispatcher feeding it. USAGE
Consumers are advised to destroy all Objects that originate Event Streams that feed an instance of the Event Dispatcher before destroying it. An exception to this rule is Event Dispatchers of an IA. Freeing an IA automatically destroys all Objects associated with it directly and indirectly, including Event Dispatchers. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard: uDAPL, 1.1, 1.2 | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
libdat(3LIB), attributes(5) SunOS 5.11 16 Jul 2004 dat_evd_free(3DAT)
Man Page