Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Asynch_Connector Class Template Reference

This class is an example of the Connector pattern. This class will establish new connections and create new HANDLER objects to handle the new connections. More...

#include <Asynch_Connector.h>

Inheritance diagram for ACE_Asynch_Connector:

Inheritance graph
[legend]
Collaboration diagram for ACE_Asynch_Connector:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_Asynch_Connector (void)
 A do nothing constructor. More...

virtual ~ACE_Asynch_Connector (void)
 Virtual destruction. More...

virtual int open (int pass_addresses=0, ACE_Proactor *proactor=0, int validate_new_connection=0)
 This opens asynch connector. More...

virtual int connect (const ACE_INET_Addr &remote_sap, const ACE_INET_Addr &local_sap=ACE_INET_Addr((u_short) 0), int reuse_addr=1, const void *act=0)
 This initiates a new asynchronous connect. More...

virtual int cancel (void)
 This cancels all pending accepts operations that were issued by the calling thread. More...

virtual int validate_new_connection (const ACE_INET_Addr &remote_address)
 Template method for address validation. More...

virtual int pass_addresses (void) const
 Set and get flag that indicates if parsing and passing of addresses to the service_handler is necessary. More...

virtual void pass_addresses (int new_value)
virtual int validate_new_connection (void) const
 Set and get flag that indicates if address validation is required. More...

virtual void validate_new_connection (int new_value)

Protected Methods

virtual void handle_connect (const ACE_Asynch_Connect::Result &result)
 This is called when an outstanding accept completes. More...

void parse_address (const ACE_Asynch_Connect::Result &result, ACE_INET_Addr &remote_address, ACE_INET_Addr &local_address)
 This parses the address from read buffer. More...

ACE_Asynch_Connectasynch_connect (void)
 Return the asynch Connect object. More...

virtual HANDLER * make_handler (void)
 This is the template method used to create new handler. More...


Private Attributes

ACE_Asynch_Connect asynch_connect_
 Asynch_Connect used to make life easier :-). More...

int pass_addresses_
 Flag that indicates if parsing of addresses is necessary. More...

int validate_new_connection_
 Flag that indicates if address validation is required. More...


Detailed Description

template<class HANDLER>
class ACE_Asynch_Connector< HANDLER >

This class is an example of the Connector pattern. This class will establish new connections and create new HANDLER objects to handle the new connections.

Unlike the ACE_Connector, however, this class is designed to be used asynchronously with the ACE Proactor framework.


Constructor & Destructor Documentation

template<class HANDLER>
ACE_Asynch_Connector< HANDLER >::ACE_Asynch_Connector void   
 

A do nothing constructor.

template<class HANDLER>
ACE_Asynch_Connector< HANDLER >::~ACE_Asynch_Connector void    [virtual]
 

Virtual destruction.


Member Function Documentation

template<class HANDLER>
ACE_Asynch_Connect & ACE_Asynch_Connector< HANDLER >::asynch_connect void    [protected]
 

Return the asynch Connect object.

template<class HANDLER>
int ACE_Asynch_Connector< HANDLER >::cancel void    [virtual]
 

This cancels all pending accepts operations that were issued by the calling thread.

Note:
On Windows, this method does not cancel connect operations issued by other threads.
Note:
On POSIX, delegates cancelation to ACE_POSIX_Asynch_Connect.

template<class HANDLER>
int ACE_Asynch_Connector< HANDLER >::connect const ACE_INET_Addr   remote_sap,
const ACE_INET_Addr   local_sap = ACE_INET_Addr ((u_short)0),
int    reuse_addr = 1,
const void *    act = 0
[virtual]
 

This initiates a new asynchronous connect.

template<class HANDLER>
void ACE_Asynch_Connector< HANDLER >::handle_connect const ACE_Asynch_Connect::Result   result [protected, virtual]
 

This is called when an outstanding accept completes.

Reimplemented from ACE_Handler.

template<class HANDLER>
HANDLER * ACE_Asynch_Connector< HANDLER >::make_handler void    [protected, virtual]
 

This is the template method used to create new handler.

Subclasses must overwrite this method if a new handler creation strategy is required.

template<class HANDLER>
int ACE_Asynch_Connector< HANDLER >::open int    pass_addresses = 0,
ACE_Proactor   proactor = 0,
int    validate_new_connection = 0
[virtual]
 

This opens asynch connector.

template<class HANDLER>
void ACE_Asynch_Connector< HANDLER >::parse_address const ACE_Asynch_Connect::Result   result,
ACE_INET_Addr   remote_address,
ACE_INET_Addr   local_address
[protected]
 

This parses the address from read buffer.

template<class HANDLER>
void ACE_Asynch_Connector< HANDLER >::pass_addresses int    new_value [virtual]
 

template<class HANDLER>
int ACE_Asynch_Connector< HANDLER >::pass_addresses void    const [virtual]
 

Set and get flag that indicates if parsing and passing of addresses to the service_handler is necessary.

template<class HANDLER>
void ACE_Asynch_Connector< HANDLER >::validate_new_connection int    new_value [virtual]
 

template<class HANDLER>
int ACE_Asynch_Connector< HANDLER >::validate_new_connection void    const [virtual]
 

Set and get flag that indicates if address validation is required.

template<class HANDLER>
int ACE_Asynch_Connector< HANDLER >::validate_new_connection const ACE_INET_Addr   remote_address [virtual]
 

Template method for address validation.

Default implemenation always validates the remote address.


Member Data Documentation

template<class HANDLER>
ACE_Asynch_Connect ACE_Asynch_Connector::asynch_connect_ [private]
 

Asynch_Connect used to make life easier :-).

template<class HANDLER>
int ACE_Asynch_Connector::pass_addresses_ [private]
 

Flag that indicates if parsing of addresses is necessary.

template<class HANDLER>
int ACE_Asynch_Connector::validate_new_connection_ [private]
 

Flag that indicates if address validation is required.


The documentation for this class was generated from the following files:
Generated on Thu May 23 00:15:34 2002 for ACE by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001