ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER,, CACHING_STRATEGY, ATTRIBUTES, MUTEX > Class Template ReferenceA connection strategy which caches connections to peers (represented by SVC_HANDLER instances), thereby allowing subsequent re-use of unused, but available, connections. More...
Inheritance diagram for ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER,, CACHING_STRATEGY, ATTRIBUTES, MUTEX >:
![]()
Collaboration diagram for ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER,, CACHING_STRATEGY, ATTRIBUTES, MUTEX >:
![]()
Detailed Descriptiontemplate<class SVC_HANDLER, ACE_PEER_CONNECTOR_1, class CACHING_STRATEGY, class ATTRIBUTES, class MUTEX>
A connection strategy which caches connections to peers (represented by SVC_HANDLER instances), thereby allowing subsequent re-use of unused, but available, connections.
|
typedef ACE_Refcounted_Hash_Recyclable<ACE_PEER_CONNECTOR_ADDR> ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER,, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::REFCOUNTED_HASH_RECYCLABLE_ADDRESS |
typedef ACE_Hash_Cache_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDRESS, SVC_HANDLER *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDRESS>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDRESS>, CACHING_STRATEGY, ATTRIBUTES> ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER,, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::CONNECTION_CACHE |
typedef CONNECTION_CACHE::CACHE_ENTRY ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER,, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::CONNECTION_CACHE_ENTRY |
typedef CONNECTION_CACHE::key_type ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER,, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::KEY |
typedef CONNECTION_CACHE::mapped_type ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER,, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::VALUE |
typedef ACE_Recyclable_Handler_Cleanup_Strategy<REFCOUNTED_HASH_RECYCLABLE_ADDRESS, ACE_Pair<SVC_HANDLER *, ATTRIBUTES>, ACE_Hash_Map_Manager_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDRESS, ACE_Pair<SVC_HANDLER *, ATTRIBUTES>, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDRESS>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDRESS>, MUTEX> > ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER,, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::CLEANUP_STRATEGY |
typedef ACE_Cached_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX> ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER,, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::CCSBASE |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, _ACE_PEER_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::ACE_Cached_Connect_Strategy_Ex | ( | CACHING_STRATEGY & | caching_s, | |
ACE_Creation_Strategy< SVC_HANDLER > * | cre_s = 0 , |
|||
ACE_Concurrency_Strategy< SVC_HANDLER > * | con_s = 0 , |
|||
ACE_Recycling_Strategy< SVC_HANDLER > * | rec_s = 0 , |
|||
MUTEX * | lock = 0 , |
|||
int | delete_lock = 0 | |||
) | [inline] |
Constructor.
ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, _ACE_PEER_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::~ACE_Cached_Connect_Strategy_Ex | ( | void | ) | [inline, virtual] |
Destructor.
int ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, _ACE_PEER_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::purge_connections | ( | void | ) | [inline, virtual] |
Explicit purging of connection entries from the connection cache.
int ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, _ACE_PEER_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::mark_as_closed_i | ( | const void * | recycling_act | ) | [inline, virtual] |
Mark as closed (non-locking version). This is used during the cleanup of the connections purged.
Reimplemented from ACE_Cached_Connect_Strategy< SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX >.
void ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, _ACE_PEER_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::cleanup | ( | void | ) | [inline] |
Since g++ version < 2.8 arent happy with templates, this special method had to be devised to avoid memory leaks and perform cleanup of the <connection_cache_>.
CACHING_STRATEGY & ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, _ACE_PEER_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::caching_strategy | ( | void | ) | [inline] |
int ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, _ACE_PEER_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::find | ( | ACE_Refcounted_Hash_Recyclable< ACE_PEER_CONNECTOR_ADDR > & | search_addr, | |
ACE_Hash_Map_Entry< ACE_Refcounted_Hash_Recyclable< ACE_PEER_CONNECTOR_ADDR >, ACE_Pair< SVC_HANDLER *, ATTRIBUTES > > *& | entry | |||
) | [inline, protected] |
Find an idle handle.
int ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, _ACE_PEER_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::purge_i | ( | const void * | recycling_act | ) | [inline, protected, virtual] |
Remove from cache (non-locking version).
Reimplemented from ACE_Cached_Connect_Strategy< SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX >.
int ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, _ACE_PEER_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::cache_i | ( | const void * | recycling_act | ) | [inline, protected, virtual] |
Add to cache (non-locking version).
Reimplemented from ACE_Cached_Connect_Strategy< SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX >.
int ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, _ACE_PEER_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::recycle_state_i | ( | const void * | recycling_act, | |
ACE_Recyclable_State | new_state | |||
) | [inline, protected, virtual] |
Get/Set <recycle_state> (non-locking version).
Reimplemented from ACE_Cached_Connect_Strategy< SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX >.
ACE_Recyclable_State ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, _ACE_PEER_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::recycle_state_i | ( | const void * | recycling_act | ) | const [inline, protected, virtual] |
Get <recycle_state> (non-locking version).
Reimplemented from ACE_Cached_Connect_Strategy< SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX >.
int ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, _ACE_PEER_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::cleanup_hint_i | ( | const void * | recycling_act, | |
void ** | act_holder | |||
) | [inline, protected, virtual] |
Cleanup hint and reset <*act_holder> to zero if <act_holder != 0>.
Reimplemented from ACE_Cached_Connect_Strategy< SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX >.
int ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, _ACE_PEER_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::check_hint_i | ( | SVC_HANDLER *& | sh, | |
const ACE_PEER_CONNECTOR_ADDR & | remote_addr, | |||
ACE_Time_Value * | timeout, | |||
const ACE_PEER_CONNECTOR_ADDR & | local_addr, | |||
int | reuse_addr, | |||
int | flags, | |||
int | perms, | |||
ACE_Hash_Map_Entry< ACE_Refcounted_Hash_Recyclable< ACE_PEER_CONNECTOR_ADDR >, ACE_Pair< SVC_HANDLER *, ATTRIBUTES > > *& | entry, | |||
int & | found | |||
) | [inline, protected] |
int ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, _ACE_PEER_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::find_or_create_svc_handler_i | ( | SVC_HANDLER *& | sh, | |
const ACE_PEER_CONNECTOR_ADDR & | remote_addr, | |||
ACE_Time_Value * | timeout, | |||
const ACE_PEER_CONNECTOR_ADDR & | local_addr, | |||
int | reuse_addr, | |||
int | flags, | |||
int | perms, | |||
ACE_Hash_Map_Entry< ACE_Refcounted_Hash_Recyclable< ACE_PEER_CONNECTOR_ADDR >, ACE_Pair< SVC_HANDLER *, ATTRIBUTES > > *& | entry, | |||
int & | found | |||
) | [inline, protected, virtual] |
int ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, _ACE_PEER_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::connect_svc_handler_i | ( | SVC_HANDLER *& | sh, | |
const ACE_PEER_CONNECTOR_ADDR & | remote_addr, | |||
ACE_Time_Value * | timeout, | |||
const ACE_PEER_CONNECTOR_ADDR & | local_addr, | |||
int | reuse_addr, | |||
int | flags, | |||
int | perms, | |||
int & | found | |||
) | [inline, protected, virtual] |
Reimplemented from ACE_Cached_Connect_Strategy< SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX >.
int ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER, _ACE_PEER_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::cached_connect | ( | SVC_HANDLER *& | sh, | |
const ACE_PEER_CONNECTOR_ADDR & | remote_addr, | |||
ACE_Time_Value * | timeout, | |||
const ACE_PEER_CONNECTOR_ADDR & | local_addr, | |||
int | reuse_addr, | |||
int | flags, | |||
int | perms | |||
) | [inline, protected, virtual] |
Connection of the svc_handler with the remote host. This method also encapsulates the connection done with auto_purging under the hood. If the connect failed due to the process running out of file descriptors then, auto_purging of some connections are done from the CONNECTION_CACHE. This frees the descriptors which get used in the connect process and hence the connect operation can succeed.
CONNECTION_CACHE ACE_Cached_Connect_Strategy_Ex< SVC_HANDLER,, CACHING_STRATEGY, ATTRIBUTES, MUTEX >::connection_cache_ [protected] |
Table that maintains the cache of connected SVC_HANDLERs.