This Proactor implementation does compeltion querying using
POSIX Real Time signals. sigtimedwait
/sigwaitinfo
call is
used to get the notify/get the completions.
The real-time signals that are going to be used with this
Proactor should be given apriori in the constructor, so that
those signals can be masked from asynchornous delivery.
#include <ace/POSIX_Proactor.h>
class ACE_POSIX_SIG_Proactor : public ACE_POSIX_Proactor {
public:
friend class ACE_POSIX_SIG_Asynch_Operation;
ACE_POSIX_SIG_Proactor (void);
ACE_POSIX_SIG_Proactor (const sigset_t mask_set);
virtual ~ACE_POSIX_SIG_Proactor (void);
virtual int handle_events (ACE_Time_Value &wait_time);
virtual int handle_events (void);
virtual int post_completion (ACE_POSIX_Asynch_Result *result);
virtual ACE_Asynch_Read_Stream_Impl *create_asynch_read_stream ( void );
virtual ACE_Asynch_Write_Stream_Impl *create_asynch_write_stream ( void );
virtual ACE_Asynch_Read_File_Impl *create_asynch_read_file (void);
virtual ACE_Asynch_Write_File_Impl *create_asynch_write_file ( void );
virtual ACE_Asynch_Accept_Impl *create_asynch_accept (void);
virtual ACE_Asynch_Transmit_File_Impl *create_asynch_transmit_file ( void );
virtual ACE_Asynch_Result_Impl *create_asynch_timer ( ACE_Handler &handler, const void *act, const ACE_Time_Value &tv, ACE_HANDLE event = ACE_INVALID_HANDLE, int priority = 0, int signal_number = ACE_SIGRTMIN );
protected:
int setup_signal_handler (int signal_number) const;
static void null_handler ( int signal_number, siginfo_t *info, void *context );
int mask_all (void) const;
virtual int handle_events (unsigned long milli_seconds);
sigset_t RT_completion_signals_;
};
virtual ACE_Asynch_Read_Stream_Impl *create_asynch_read_stream (void);
virtual ACE_Asynch_Write_Stream_Impl *create_asynch_write_stream (
void
);
virtual ACE_Asynch_Read_File_Impl *create_asynch_read_file (void);
virtual ACE_Asynch_Write_File_Impl *create_asynch_write_file (void);
virtual ACE_Asynch_Accept_Impl *create_asynch_accept (void);
virtual ACE_Asynch_Transmit_File_Impl *create_asynch_transmit_file (
void
);
virtual ACE_Asynch_Result_Impl *create_asynch_timer (
ACE_Handler &handler,
const void *act,
const ACE_Time_Value &tv,
ACE_HANDLE event = ACE_INVALID_HANDLE,
int priority = 0,
int signal_number = ACE_SIGRTMIN
);
signal_number
is -1, check with the Proactor and use one of
the signals that is present in the mask set (i.e. the signals for
which the Proactor will be waiting) of the Proactor. If there are
more than one signal, the higher numbered signal will be chosen.
irfan@cs.wustl.edu
,
Tim Harrison harrison@cs.wustl.edu
and
Alexander Babu Arulanthu alex@cs.wustl.edu