#include <WIN32_Asynch_IO.h>
Inheritance diagram for ACE_WIN32_Asynch_Connect:
Public Member Functions | |
ACE_WIN32_Asynch_Connect (ACE_WIN32_Proactor *win32_proactor) | |
Constructor. | |
virtual | ~ACE_WIN32_Asynch_Connect (void) |
Destructor. | |
int | open (const ACE_Handler::Proxy_Ptr &handler_proxy, ACE_HANDLE handle, const void *completion_key, ACE_Proactor *proactor=0) |
int | connect (ACE_HANDLE connect_handle, const ACE_Addr &remote_sap, const ACE_Addr &local_sap, int reuse_addr, const void *act, int priority, int signal_number=0) |
int | cancel (void) |
int | close (void) |
ACE_HANDLE | get_handle (void) const |
Virtual from ACE_Event_Handler. | |
void | set_handle (ACE_HANDLE handle) |
Virtual from ACE_Event_Handler. | |
int | handle_input (ACE_HANDLE handle) |
Virtual from ACE_Event_Handler. | |
int | handle_output (ACE_HANDLE handle) |
int | handle_exception (ACE_HANDLE handle) |
Called when an exceptional events occur (e.g., SIGURG). | |
int | handle_close (ACE_HANDLE handle, ACE_Reactor_Mask close_mask) |
Virtual from ACE_Event_Handler. | |
ACE_Proactor * | proactor (void) const |
Return the underlying proactor. | |
Private Types | |
typedef ACE_Map_Manager< ACE_HANDLE, ACE_WIN32_Asynch_Connect_Result *, ACE_SYNCH_NULL_MUTEX > | MAP_MANAGER |
Private Member Functions | |
int | connect_i (ACE_WIN32_Asynch_Connect_Result *result, const ACE_Addr &remote_sap, const ACE_Addr &local_sap, int reuse_addr) |
int | post_result (ACE_WIN32_Asynch_Connect_Result *result, bool flg_post) |
int | cancel_uncompleted (bool flg_notify, ACE_Handle_Set &set) |
Cancel uncompleted connect operations. | |
Private Attributes | |
bool | flg_open_ |
MAP_MANAGER | result_map_ |
ACE_SYNCH_MUTEX | lock_ |
typedef ACE_Map_Manager<ACE_HANDLE, ACE_WIN32_Asynch_Connect_Result *, ACE_SYNCH_NULL_MUTEX> ACE_WIN32_Asynch_Connect::MAP_MANAGER [private] |
ACE_WIN32_Asynch_Connect::ACE_WIN32_Asynch_Connect | ( | ACE_WIN32_Proactor * | win32_proactor | ) |
Constructor.
ACE_WIN32_Asynch_Connect::~ACE_WIN32_Asynch_Connect | ( | void | ) | [virtual] |
Destructor.
int ACE_WIN32_Asynch_Connect::cancel | ( | void | ) | [virtual] |
Cancel all pending pseudo-asynchronus requests Behavior as usual AIO request
Reimplemented from ACE_WIN32_Asynch_Operation.
int ACE_WIN32_Asynch_Connect::cancel_uncompleted | ( | bool | flg_notify, | |
ACE_Handle_Set & | set | |||
) | [private] |
Cancel uncompleted connect operations.
flg_notify | Indicates whether or not to send notification about canceled connect operations. If false, don't send notifications. If true, notify user about canceled connects. According WIN32 standards we should receive notifications on canceled AIO requests. | |
set | Receives the set of I/O handles on which asynchronous connect requests were canceled as a result of this method. The contents of set are completely replaced. |
int ACE_WIN32_Asynch_Connect::close | ( | void | ) |
Close performs cancellation of all pending requests and close the connect handle
int ACE_WIN32_Asynch_Connect::connect | ( | ACE_HANDLE | connect_handle, | |
const ACE_Addr & | remote_sap, | |||
const ACE_Addr & | local_sap, | |||
int | reuse_addr, | |||
const void * | act, | |||
int | priority, | |||
int | signal_number = 0 | |||
) | [virtual] |
Start an asynchronous connect.
connect_handle | Handle to use for the connect. If the value ACE_INVALID_HANDLE, a new handle will be created. |
0 | Success | |
-1 | Error |
Implements ACE_Asynch_Connect_Impl.
int ACE_WIN32_Asynch_Connect::connect_i | ( | ACE_WIN32_Asynch_Connect_Result * | result, | |
const ACE_Addr & | remote_sap, | |||
const ACE_Addr & | local_sap, | |||
int | reuse_addr | |||
) | [private] |
ACE_HANDLE ACE_WIN32_Asynch_Connect::get_handle | ( | void | ) | const [virtual] |
int ACE_WIN32_Asynch_Connect::handle_close | ( | ACE_HANDLE | handle, | |
ACE_Reactor_Mask | close_mask | |||
) | [virtual] |
int ACE_WIN32_Asynch_Connect::handle_exception | ( | ACE_HANDLE | handle | ) | [virtual] |
int ACE_WIN32_Asynch_Connect::handle_input | ( | ACE_HANDLE | handle | ) | [virtual] |
int ACE_WIN32_Asynch_Connect::handle_output | ( | ACE_HANDLE | handle | ) | [virtual] |
Called when output events are possible (e.g., when flow control abates or non-blocking connection completes).
Reimplemented from ACE_Event_Handler.
int ACE_WIN32_Asynch_Connect::open | ( | const ACE_Handler::Proxy_Ptr & | handler_proxy, | |
ACE_HANDLE | handle, | |||
const void * | completion_key, | |||
ACE_Proactor * | proactor = 0 | |||
) | [virtual] |
This open belongs to ACE_WIN32_Asynch_Operation. We forward this call to that method. We have put this here to avoid the compiler warnings.
Reimplemented from ACE_WIN32_Asynch_Operation.
int ACE_WIN32_Asynch_Connect::post_result | ( | ACE_WIN32_Asynch_Connect_Result * | result, | |
bool | flg_post | |||
) | [private] |
ACE_Proactor * ACE_WIN32_Asynch_Connect::proactor | ( | void | ) | const [virtual] |
void ACE_WIN32_Asynch_Connect::set_handle | ( | ACE_HANDLE | handle | ) | [virtual] |
bool ACE_WIN32_Asynch_Connect::flg_open_ [private] |
true - Connect is registered in ACE_Asynch_Pseudo_Task false - Accept is deregisted in ACE_Asynch_Pseudo_Task
ACE_SYNCH_MUTEX ACE_WIN32_Asynch_Connect::lock_ [private] |
The lock to protect the result map which is shared. The queue is updated by main thread in the register function call and through the auxillary thread in the asynch pseudo task.
Map of Result pointers that correspond to all the <accept>'s pending.