NAME

ACE_Reactor_Notify - Unblock the ACE_Reactor from its event loop.

SYNOPSIS

#include <ace/Reactor.h>

class ACE_Reactor_Notify : public ACE_Event_Handler { public: int open (ACE_Reactor *); int close (void); int dispatch_notifications ( int &number_of_active_handles, const ACE_Handle_Set &rd_mask ); ssize_t notify ( ACE_Event_Handler * = 0, ACE_Reactor_Mask = ACE_Event_Handler::EXCEPT_MASK, ACE_Time_Value * = 0 ); virtual int handle_input (ACE_HANDLE handle); void dump (void) const; ACE_ALLOC_HOOK_DECLARE; private: ACE_Reactor *reactor_; ACE_Pipe notification_pipe_; };

DESCRIPTION

This implementation is necessary for cases where the ACE_Reactor is run in a multi-threaded program. In this case, we need to be able to unblock select() or poll() when updates occur other than in the main ACE_Reactor thread. To do this, we signal an auto-reset event the ACE_Reactor is listening on. If an ACE_Event_Handler and ACE_Reactor_Mask is passed to notify, the appropriate handle_* method is dispatched in the context of the ACE_Reactor thread.

Initialization and termination methods.

int open (ACE_Reactor *);

int close (void);

int dispatch_notifications (
    int &number_of_active_handles,
    const ACE_Handle_Set &rd_mask
    );

ssize_t notify (
    ACE_Event_Handler * = 0,
    ACE_Reactor_Mask = ACE_Event_Handler::EXCEPT_MASK,
    ACE_Time_Value * = 0
    );

virtual int handle_input (ACE_HANDLE handle);

void dump (void) const;

ACE_ALLOC_HOOK_DECLARE;

AUTHOR

Doug Schmidt

LIBRARY

ace