ACE_Strategy_Acceptor< SVC_HANDLER, > Class Template ReferenceAbstract factory for creating a service handler (SVC_HANDLER), accepting into the SVC_HANDLER, and activating the SVC_HANDLER. More...
Inheritance diagram for ACE_Strategy_Acceptor< SVC_HANDLER, >:
![]()
Collaboration diagram for ACE_Strategy_Acceptor< SVC_HANDLER, >:
![]()
Detailed Descriptiontemplate<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1>
Abstract factory for creating a service handler (SVC_HANDLER), accepting into the SVC_HANDLER, and activating the SVC_HANDLER.
|
typedef ACE_Creation_Strategy<SVC_HANDLER> ACE_Strategy_Acceptor< SVC_HANDLER, >::creation_strategy_type |
typedef ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2> ACE_Strategy_Acceptor< SVC_HANDLER, >::accept_strategy_type |
typedef ACE_Concurrency_Strategy<SVC_HANDLER> ACE_Strategy_Acceptor< SVC_HANDLER, >::concurrency_strategy_type |
typedef ACE_Scheduling_Strategy<SVC_HANDLER> ACE_Strategy_Acceptor< SVC_HANDLER, >::scheduling_strategy_type |
typedef ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2> ACE_Strategy_Acceptor< SVC_HANDLER, >::base_type |
typedef ACE_Creation_Strategy<SVC_HANDLER> ACE_Strategy_Acceptor< SVC_HANDLER, >::CREATION_STRATEGY |
typedef ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2> ACE_Strategy_Acceptor< SVC_HANDLER, >::ACCEPT_STRATEGY |
typedef ACE_Concurrency_Strategy<SVC_HANDLER> ACE_Strategy_Acceptor< SVC_HANDLER, >::CONCURRENCY_STRATEGY |
typedef ACE_Scheduling_Strategy<SVC_HANDLER> ACE_Strategy_Acceptor< SVC_HANDLER, >::SCHEDULING_STRATEGY |
ACE_Strategy_Acceptor< SVC_HANDLER, >::ACE_Strategy_Acceptor | ( | const ACE_TCHAR | service_name[] = 0 , |
|
const ACE_TCHAR | service_description[] = 0 , |
|||
int | use_select = 1 , |
|||
int | reuse_addr = 1 | |||
) | [inline] |
Default constructor.
ACE_Strategy_Acceptor< SVC_HANDLER, >::ACE_Strategy_Acceptor | ( | const ACE_PEER_ACCEPTOR_ADDR & | local_addr, | |
ACE_Reactor * | reactor = ACE_Reactor::instance () , |
|||
ACE_Creation_Strategy< SVC_HANDLER > * | cre_s = 0 , |
|||
ACE_Accept_Strategy< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 > * | acc_s = 0 , |
|||
ACE_Concurrency_Strategy< SVC_HANDLER > * | con_s = 0 , |
|||
ACE_Scheduling_Strategy< SVC_HANDLER > * | sch_s = 0 , |
|||
const ACE_TCHAR | service_name[] = 0 , |
|||
const ACE_TCHAR | service_description[] = 0 , |
|||
int | use_select = 1 , |
|||
int | reuse_addr = 1 | |||
) | [inline] |
Initialize the appropriate strategies for creation, passive connection acceptance, and concurrency, and then register {this} with the Reactor and listen for connection requests at the designated {local_addr}.
ACE_Strategy_Acceptor< SVC_HANDLER, >::~ACE_Strategy_Acceptor | ( | void | ) | [inline, virtual] |
Close down the Strategy_Acceptor's resources.
int ACE_Strategy_Acceptor< SVC_HANDLER, >::open | ( | const ACE_PEER_ACCEPTOR_ADDR & | local_addr, | |
ACE_Reactor * | reactor, | |||
int | flags = 0 , |
|||
int | use_select = 1 , |
|||
int | reuse_addr = 1 | |||
) | [inline, virtual] |
Open the contained PEER_ACCEPTOR
object to begin listening, and register with the specified reactor for accept events.
The PEER_ACCEPTOR
handle is put into non-blocking mode as a safeguard against the race condition that can otherwise occur between the time when the passive-mode socket handle is "ready" and when the actual accept
call is made. During this interval, the client can shutdown the connection, in which case, the {accept} call can hang.
local_addr | The address to listen at. | |
reactor | Pointer to the ACE_Reactor instance to register this object with. The default is the singleton. | |
flags | Flags to control what mode an accepted socket will be put into after it is accepted. The only legal value for this argument is ACE_NONBLOCK , which enables non-blocking mode on the accepted peer stream object in SVC_HANDLER . The default is 0. | |
use_select | Affects behavior when called back by the reactor when a connection can be accepted. If non-zero, this object will accept all pending connections, intead of just the one that triggered the reactor callback. Uses ACE_OS::select() internally to detect any remaining acceptable connections. The default is 1. | |
reuse_addr | Passed to the PEER_ACCEPTOR::open() method with local_addr . Generally used to request that the OS allow reuse of the listen port. The default is 1. |
0 | Success | |
-1 | Failure, errno contains an error code. |
Reimplemented from ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >.
int ACE_Strategy_Acceptor< SVC_HANDLER, >::open | ( | const ACE_PEER_ACCEPTOR_ADDR & | local_addr, | |
ACE_Reactor * | reactor = ACE_Reactor::instance () , |
|||
ACE_Creation_Strategy< SVC_HANDLER > * | cre_s = 0 , |
|||
ACE_Accept_Strategy< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 > * | acc_s = 0 , |
|||
ACE_Concurrency_Strategy< SVC_HANDLER > * | con_s = 0 , |
|||
ACE_Scheduling_Strategy< SVC_HANDLER > * | sch_s = 0 , |
|||
const ACE_TCHAR * | service_name = 0 , |
|||
const ACE_TCHAR * | service_description = 0 , |
|||
int | use_select = 1 , |
|||
int | reuse_addr = 1 | |||
) | [inline, virtual] |
Initialize the appropriate strategies for creation, passive connection acceptance, and concurrency, and then register {this} with the Reactor and listen for connection requests at the designated {local_addr}.
ACE_Strategy_Acceptor< SVC_HANDLER, >::operator ACE_PEER_ACCEPTOR & | ( | ) | const [inline, virtual] |
Return the underlying PEER_ACCEPTOR object.
Reimplemented from ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >.
ACE_PEER_ACCEPTOR & ACE_Strategy_Acceptor< SVC_HANDLER, >::acceptor | ( | void | ) | const [inline, virtual] |
Return the underlying PEER_ACCEPTOR object.
Reimplemented from ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >.
ACE_HANDLE ACE_Strategy_Acceptor< SVC_HANDLER, >::get_handle | ( | void | ) | const [inline, virtual] |
Returns the listening acceptor's {ACE_HANDLE}.
Reimplemented from ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >.
void ACE_Strategy_Acceptor< SVC_HANDLER, >::dump | ( | void | ) | const [inline] |
int ACE_Strategy_Acceptor< SVC_HANDLER, >::suspend | ( | void | ) | [inline, virtual] |
This method delegates to the {Scheduling_Strategy}'s {suspend} method.
Reimplemented from ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >.
int ACE_Strategy_Acceptor< SVC_HANDLER, >::resume | ( | void | ) | [inline, virtual] |
This method delegates to the {Scheduling_Strategy}'s {resume} method.
Reimplemented from ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >.
int ACE_Strategy_Acceptor< SVC_HANDLER, >::fini | ( | void | ) | [inline, protected, virtual] |
Calls {handle_close} when dynamically unlinked.
Reimplemented from ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >.
int ACE_Strategy_Acceptor< SVC_HANDLER, >::info | ( | ACE_TCHAR ** | buf, | |
size_t | length | |||
) | const [inline, protected, virtual] |
Default version returns address info in {buf}.
Reimplemented from ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >.
int ACE_Strategy_Acceptor< SVC_HANDLER, >::make_svc_handler | ( | SVC_HANDLER *& | sh | ) | [inline, protected, virtual] |
Bridge method for creating a {SVC_HANDLER}. The strategy for creating a {SVC_HANDLER} are configured into the Acceptor via it's {creation_strategy_}. The default is to create a new {SVC_HANDLER} if {sh} == 0, else {sh} is unchanged. However, subclasses can override this policy to perform {SVC_HANDLER} creation in any way that they like (such as creating subclass instances of {SVC_HANDLER}, using a singleton, dynamically linking the handler, etc.). Returns -1 on failure, else 0.
Reimplemented from ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >.
int ACE_Strategy_Acceptor< SVC_HANDLER, >::accept_svc_handler | ( | SVC_HANDLER * | svc_handler | ) | [inline, protected, virtual] |
Bridge method for accepting the new connection into the {SVC_HANDLER}. The default behavior delegates to the {PEER_ACCEPTOR::accept} in the {Acceptor_Strategy}.
Reimplemented from ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >.
int ACE_Strategy_Acceptor< SVC_HANDLER, >::activate_svc_handler | ( | SVC_HANDLER * | svc_handler | ) | [inline, protected, virtual] |
Bridge method for activating a {SVC_HANDLER} with the appropriate concurrency strategy. The default behavior of this method is to activate the {SVC_HANDLER} by calling its {open} method (which allows the {SVC_HANDLER} to define its own concurrency strategy). However, subclasses can override this strategy to do more sophisticated concurrency activations (such as creating the {SVC_HANDLER} as an "active object" via multi-threading or multi-processing).
Reimplemented from ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >.
int ACE_Strategy_Acceptor< SVC_HANDLER, >::handle_close | ( | ACE_HANDLE | = ACE_INVALID_HANDLE , |
|
ACE_Reactor_Mask | = ACE_Event_Handler::ALL_EVENTS_MASK | |||
) | [inline, protected, virtual] |
Perform termination activities when {this} is removed from the {Reactor}.
Reimplemented from ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >.
int ACE_Strategy_Acceptor< SVC_HANDLER, >::handle_signal | ( | int | signum, | |
siginfo_t * | , | |||
ucontext_t * | ||||
) | [inline, protected, virtual] |
ACE_Strategy_Acceptor< SVC_HANDLER, >::ACE_ALLOC_HOOK_DECLARE |
Declare the dynamic allocation hooks.
Reimplemented from ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >.
CREATION_STRATEGY* ACE_Strategy_Acceptor< SVC_HANDLER, >::creation_strategy_ [protected] |
Creation strategy for an Acceptor.
bool ACE_Strategy_Acceptor< SVC_HANDLER, >::delete_creation_strategy_ [protected] |
true if {Acceptor} created the creation strategy and thus should delete it, else false.
ACCEPT_STRATEGY* ACE_Strategy_Acceptor< SVC_HANDLER, >::accept_strategy_ [protected] |
Accept strategy for an {Acceptor}.
bool ACE_Strategy_Acceptor< SVC_HANDLER, >::delete_accept_strategy_ [protected] |
true if {Acceptor} created the accept strategy and thus should delete it, else false.
CONCURRENCY_STRATEGY* ACE_Strategy_Acceptor< SVC_HANDLER, >::concurrency_strategy_ [protected] |
Concurrency strategy for an {Acceptor}.
bool ACE_Strategy_Acceptor< SVC_HANDLER, >::delete_concurrency_strategy_ [protected] |
true if {Acceptor} created the concurrency strategy and thus should delete it, else false.
SCHEDULING_STRATEGY* ACE_Strategy_Acceptor< SVC_HANDLER, >::scheduling_strategy_ [protected] |
Scheduling strategy for an {Acceptor}.
bool ACE_Strategy_Acceptor< SVC_HANDLER, >::delete_scheduling_strategy_ [protected] |
true if {Acceptor} created the scheduling strategy and thus should delete it, else false.
ACE_TCHAR* ACE_Strategy_Acceptor< SVC_HANDLER, >::service_name_ [protected] |
Name of the service.
ACE_TCHAR* ACE_Strategy_Acceptor< SVC_HANDLER, >::service_description_ [protected] |
Description of the service.
ACE_PEER_ACCEPTOR_ADDR ACE_Strategy_Acceptor< SVC_HANDLER, >::service_addr_ [protected] |
Address that the {Strategy_Acceptor} uses to listen for connections.