#include <POSIX_Proactor.h>
Inheritance diagram for ACE_POSIX_AIOCB_Proactor:
Public Methods | |
ACE_POSIX_AIOCB_Proactor (size_t nmaxop=ACE_AIO_DEFAULT_SIZE) | |
Constructor defines max number asynchronous operations which can be started at the same time. More... | |
virtual Proactor_Type | get_impl_type (void) |
virtual | ~ACE_POSIX_AIOCB_Proactor (void) |
Destructor. More... | |
virtual int | close (void) |
Close down the Proactor. More... | |
virtual int | handle_events (ACE_Time_Value &wait_time) |
Dispatch a single set of events. More... | |
virtual int | handle_events (void) |
Block indefinitely until at least one event is dispatched. More... | |
virtual int | post_completion (ACE_POSIX_Asynch_Result *result) |
Post a result to the completion port of the Proactor. More... | |
virtual ACE_Asynch_Read_Stream_Impl * | create_asynch_read_stream (void) |
Create the correct implementation class for doing Asynch_Read_Stream. More... | |
virtual ACE_Asynch_Write_Stream_Impl * | create_asynch_write_stream (void) |
Create the correct implementation class for doing Asynch_Write_Stream. More... | |
virtual ACE_Asynch_Read_Dgram_Impl * | create_asynch_read_dgram (void) |
Create the correct implementation class for doing Asynch_Read_Dgram. More... | |
virtual ACE_Asynch_Write_Dgram_Impl * | create_asynch_write_dgram (void) |
Create the correct implementation class for doing Asynch_Write_Dgram. More... | |
virtual ACE_Asynch_Read_File_Impl * | create_asynch_read_file (void) |
Create the correct implementation class for doing Asynch_Read_File. More... | |
virtual ACE_Asynch_Write_File_Impl * | create_asynch_write_file (void) |
Create the correct implementation class for doing Asynch_Write_File. More... | |
virtual ACE_Asynch_Accept_Impl * | create_asynch_accept (void) |
Create the correct implementation class for doing Asynch_Accept. More... | |
virtual ACE_Asynch_Connect_Impl * | create_asynch_connect (void) |
Create the correct implementation class for doing Asynch_Connect. More... | |
virtual ACE_Asynch_Transmit_File_Impl * | create_asynch_transmit_file (void) |
Create the correct implementation class for doing Asynch_Transmit_File. More... | |
virtual int | cancel_aio (ACE_HANDLE h) |
This method should be called from ACE_POSIX_Asynch_Operation::cancel() instead of usual aio_cancel. More... | |
Protected Methods | |
ACE_POSIX_AIOCB_Proactor (size_t nmaxop, ACE_POSIX_Proactor::Proactor_Type ptype) | |
Special constructor for ACE_SUN_Proactor and ACE_POSIX_SIG_Proactor. More... | |
virtual int | get_result_status (ACE_POSIX_Asynch_Result *asynch_result, int &error_status, int &return_status) |
Check AIO for completion, error and result status Return: 1 - AIO completed , 0 - not completed yet. More... | |
ACE_Asynch_Pseudo_Task & | get_asynch_pseudo_task () |
Task to process pseudo-asynchronous operations. More... | |
int | create_result_aiocb_list (void) |
Create aiocb list. More... | |
int | delete_result_aiocb_list (void) |
Call this method from derived class when virtual table is built. More... | |
void | create_notify_manager (void) |
Call these methods from derived class when virtual table is built. More... | |
void | delete_notify_manager (void) |
void | check_max_aio_num (void) |
Define the maximum number of asynchronous I/O requests for the current OS. More... | |
void | set_notify_handle (ACE_HANDLE h) |
To identify requests from Notify_Pipe_Manager. More... | |
virtual int | handle_events (u_long milli_seconds) |
Dispatch a single set of events. More... | |
void | application_specific_code (ACE_POSIX_Asynch_Result *asynch_result, u_long bytes_transferred, const void *completion_key, u_long error) |
We will call the base class's application_specific_code from here. More... | |
virtual int | register_and_start_aio (ACE_POSIX_Asynch_Result *result, int op) |
virtual int | start_aio (ACE_POSIX_Asynch_Result *result) |
Op code now is saved in ACE_POSIX_Asynch_Result. More... | |
int | start_deferred_aio (void) |
Start deferred AIO if necessary. More... | |
virtual int | cancel_aiocb (ACE_POSIX_Asynch_Result *result) |
Cancel running or deferred AIO. More... | |
ACE_POSIX_Asynch_Result * | find_completed_aio (int &error_status, int &return_status, size_t &index, size_t &count) |
Extract the results of aio. More... | |
virtual int | allocate_aio_slot (ACE_POSIX_Asynch_Result *result) |
Find free slot to store result and aiocb pointer. More... | |
virtual int | notify_completion (int sig_num) |
Notify queue of "post_completed" ACE_POSIX_Asynch_Results called from post_completion method. More... | |
int | putq_result (ACE_POSIX_Asynch_Result *result) |
Put "post_completed" result into the internal queue. More... | |
ACE_POSIX_Asynch_Result * | getq_result (void) |
Get "post_completed" result from the internal queue. More... | |
int | clear_result_queue (void) |
Clear the internal results queue. More... | |
int | process_result_queue (void) |
Process the internal results queue. More... | |
Protected Attributes | |
ACE_AIOCB_Notify_Pipe_Manager * | aiocb_notify_pipe_manager_ |
This class takes care of doing <accept> when we use AIO_CONTROL_BLOCKS strategy. More... | |
aiocb ** | aiocb_list_ |
Use a dynamically allocated array to keep track of all the aio's issued currently. More... | |
ACE_POSIX_Asynch_Result ** | result_list_ |
size_t | aiocb_list_max_size_ |
To maintain the maximum size of the array (list). More... | |
size_t | aiocb_list_cur_size_ |
To maintain the current size of the array (list). More... | |
ACE_SYNCH_MUTEX | mutex_ |
Mutex to protect work with lists. More... | |
ACE_HANDLE | notify_pipe_read_handle_ |
The purpose of this member is only to identify asynchronous request from NotifyManager. We will reserve for it always slot 0 in the list of aiocb's to be sure that don't lose notifications. More... | |
size_t | num_deferred_aiocb_ |
Number of ACE_POSIX_Asynch_Result's waiting for start i.e. deferred AIOs. More... | |
size_t | num_started_aio_ |
Number active,i.e. running requests. More... | |
ACE_Unbounded_Queue< ACE_POSIX_Asynch_Result *> | result_queue_ |
Queue which keeps "post_completed" ACE_POSIX_Asynch_Result's. More... | |
ACE_Asynch_Pseudo_Task | pseudo_task_ |
Task to process pseudo-asynchronous accept. More... | |
Friends | |
class | ACE_AIOCB_Notify_Pipe_Manager |
Handler needs to call application specific code. More... | |
class | ACE_POSIX_Asynch_Operation |
This class does the registering of Asynch Operations with the Proactor which is necessary in the AIOCB strategy. More... | |
class | ACE_POSIX_Asynch_Accept |
class | ACE_POSIX_Asynch_Connect |
|
Constructor defines max number asynchronous operations which can be started at the same time.
|
|
Destructor.
|
|
Special constructor for ACE_SUN_Proactor and ACE_POSIX_SIG_Proactor.
|
|
Find free slot to store result and aiocb pointer.
Reimplemented in ACE_POSIX_SIG_Proactor. |
|
We will call the base class's application_specific_code from here.
Reimplemented from ACE_POSIX_Proactor. |
|
This method should be called from ACE_POSIX_Asynch_Operation::cancel() instead of usual aio_cancel. For all deferred AIO requests with handle "h" it removes its from the lists and notifies user. For all running AIO requests with handle "h" it calls aio_cancel. According to the POSIX standards we will receive ECANCELED for all aio_canceled AIO requests later on return from aio_suspend |
|
Cancel running or deferred AIO.
|
|
Define the maximum number of asynchronous I/O requests for the current OS.
|
|
Clear the internal results queue.
|
|
Close down the Proactor.
Reimplemented from ACE_POSIX_Proactor. |
|
Create the correct implementation class for doing Asynch_Accept.
Reimplemented from ACE_Proactor_Impl. |
|
Create the correct implementation class for doing Asynch_Connect.
Reimplemented from ACE_Proactor_Impl. |
|
Create the correct implementation class for doing Asynch_Read_Dgram.
Reimplemented from ACE_Proactor_Impl. |
|
Create the correct implementation class for doing Asynch_Read_File.
Reimplemented from ACE_Proactor_Impl. |
|
Create the correct implementation class for doing Asynch_Read_Stream.
Reimplemented from ACE_Proactor_Impl. |
|
Create the correct implementation class for doing Asynch_Transmit_File.
Reimplemented from ACE_Proactor_Impl. |
|
Create the correct implementation class for doing Asynch_Write_Dgram.
Reimplemented from ACE_Proactor_Impl. |
|
Create the correct implementation class for doing Asynch_Write_File.
Reimplemented from ACE_Proactor_Impl. |
|
Create the correct implementation class for doing Asynch_Write_Stream.
Reimplemented from ACE_Proactor_Impl. |
|
Call these methods from derived class when virtual table is built.
|
|
Create aiocb list.
|
|
|
|
Call this method from derived class when virtual table is built.
|
|
Extract the results of aio.
|
|
Task to process pseudo-asynchronous operations.
|
|
Reimplemented from ACE_POSIX_Proactor. Reimplemented in ACE_POSIX_SIG_Proactor. |
|
Check AIO for completion, error and result status Return: 1 - AIO completed , 0 - not completed yet.
|
|
Get "post_completed" result from the internal queue.
|
|
Dispatch a single set of events. If <milli_seconds> elapses before any events occur, return 0. Return 1 if a completion dispatched. Return -1 on errors. Reimplemented in ACE_POSIX_SIG_Proactor. |
|
Block indefinitely until at least one event is dispatched. Dispatch a single set of events. If <wait_time> elapses before any events occur, return 0. Return 1 on success i.e., when a completion is dispatched, non-zero (-1) on errors and errno is set accordingly. Reimplemented from ACE_Proactor_Impl. Reimplemented in ACE_POSIX_SIG_Proactor. |
|
Dispatch a single set of events. If <wait_time> elapses before any events occur, return 0. Return 1 on success i.e., when a completion is dispatched, non-zero (-1) on errors and errno is set accordingly. Reimplemented from ACE_Proactor_Impl. Reimplemented in ACE_POSIX_SIG_Proactor. |
|
Notify queue of "post_completed" ACE_POSIX_Asynch_Results called from post_completion method.
Reimplemented in ACE_POSIX_SIG_Proactor. |
|
Post a result to the completion port of the Proactor.
Reimplemented from ACE_POSIX_Proactor. |
|
Process the internal results queue.
|
|
Put "post_completed" result into the internal queue.
|
|
|
|
To identify requests from Notify_Pipe_Manager.
|
|
Op code now is saved in ACE_POSIX_Asynch_Result.
|
|
Start deferred AIO if necessary.
|
|
Handler needs to call application specific code.
|
|
|
|
|
|
This class does the registering of Asynch Operations with the Proactor which is necessary in the AIOCB strategy.
|
|
Use a dynamically allocated array to keep track of all the aio's issued currently.
|
|
To maintain the current size of the array (list).
|
|
To maintain the maximum size of the array (list).
|
|
This class takes care of doing <accept> when we use AIO_CONTROL_BLOCKS strategy.
|
|
Mutex to protect work with lists.
|
|
The purpose of this member is only to identify asynchronous request from NotifyManager. We will reserve for it always slot 0 in the list of aiocb's to be sure that don't lose notifications.
|
|
Number of ACE_POSIX_Asynch_Result's waiting for start i.e. deferred AIOs.
|
|
Number active,i.e. running requests.
|
|
Task to process pseudo-asynchronous accept.
|
|
|
|
Queue which keeps "post_completed" ACE_POSIX_Asynch_Result's.
|