#include <Acceptor.h>
Inheritance diagram for ACE_Oneshot_Acceptor< SVC_HANDLER, >:
Public Types | |
typedef ACE_PEER_ACCEPTOR_ADDR | addr_type |
typedef ACE_PEER_ACCEPTOR | acceptor_type |
typedef SVC_HANDLER | handler_type |
typedef ACE_TYPENAME SVC_HANDLER::stream_type | stream_type |
Public Member Functions | |
ACE_Oneshot_Acceptor (void) | |
Constructor. | |
ACE_Oneshot_Acceptor (const ACE_PEER_ACCEPTOR_ADDR &local_addr, ACE_Reactor *reactor=ACE_Reactor::instance(), ACE_Concurrency_Strategy< SVC_HANDLER > *=0) | |
int | open (const ACE_PEER_ACCEPTOR_ADDR &, ACE_Reactor *reactor=ACE_Reactor::instance(), ACE_Concurrency_Strategy< SVC_HANDLER > *=0) |
virtual | ~ACE_Oneshot_Acceptor (void) |
Close down the <oneshot_acceptor>. | |
virtual int | accept (SVC_HANDLER *=0, ACE_PEER_ACCEPTOR_ADDR *remote_addr=0, const ACE_Synch_Options &synch_options=ACE_Synch_Options::defaults, int restart=1, int reset_new_handle=0) |
virtual int | cancel (void) |
Cancel a oneshot acceptor that was started asynchronously. | |
virtual | operator ACE_PEER_ACCEPTOR & () const |
Return the underlying <peer_acceptor> object. | |
virtual ACE_PEER_ACCEPTOR & | acceptor (void) const |
Return the underlying <peer_acceptor> object. | |
virtual int | close (void) |
Close down the <oneshot_acceptor>. | |
void | dump (void) const |
Dump the state of an object. | |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. | |
Protected Member Functions | |
virtual int | activate_svc_handler (SVC_HANDLER *svc_handler) |
int | shared_accept (SVC_HANDLER *svc_handler, ACE_PEER_ACCEPTOR_ADDR *remote_addr, ACE_Time_Value *timeout, int restart, int reset_new_handle) |
virtual ACE_HANDLE | get_handle (void) const |
Returns the listening acceptor's <ace_handle>. | |
virtual int | handle_close (ACE_HANDLE=ACE_INVALID_HANDLE, ACE_Reactor_Mask=ACE_Event_Handler::ALL_EVENTS_MASK) |
virtual int | handle_input (ACE_HANDLE) |
virtual int | handle_timeout (const ACE_Time_Value &tv, const void *arg) |
Called when an acceptor times out... | |
virtual int | init (int argc, ACE_TCHAR *argv[]) |
virtual int | fini (void) |
virtual int | info (ACE_TCHAR **, size_t) const |
Default version returns address info in <buf>. | |
virtual int | suspend (void) |
virtual int | resume (void) |
Private Member Functions | |
int | register_handler (SVC_HANDLER *svc_handler, const ACE_Synch_Options &options, int restart) |
Private Attributes | |
SVC_HANDLER * | svc_handler_ |
Hold the svc_handler_ across asynchrony boundaries. | |
int | restart_ |
Hold the restart flag across asynchrony boundaries. | |
ACE_PEER_ACCEPTOR | peer_acceptor_ |
Factory that establishes connections passively. | |
ACE_Concurrency_Strategy< SVC_HANDLER > * | concurrency_strategy_ |
Concurrency strategy for an Acceptor. | |
int | delete_concurrency_strategy_ |
This class works similarly to the regular <ace_acceptor>, with the following differences: 1. This class doesn't automagically register <this> with the <ace_reactor> since it expects to have its <accept> method called directly. However, it stashes the <ace_reactor> pointer away in case it's needed later to finish accepting a connection asynchronously. 2. The class doesn't need an <ace_creation_strategy> (since the user supplies the SVC_HANDLER) or an <ace_accept_strategy> (since this class only accepts one connection and then removes all traces of itself from the <ace_reactor> if it was registered for asynchronous accepts).
|
|
|
|
|
|
|
|
|
Constructor.
|
|
Initialize the appropriate strategies for concurrency and then open the <peer_acceptor> at the designated <local_addr>. Note that unlike the <ace_acceptor> and <ace_strategy_acceptor>, this method does NOT register <this> acceptor with the <reactor> at this point -- it just stashes the <reactor> away in case it's needed later. |
|
Close down the <oneshot_acceptor>.
|
|
Create a <svc_handler>, accept the connection into the <svc_handler>, and activate the <svc_handler>. |
|
Return the underlying <peer_acceptor> object.
|
|
Bridge method for activating a <svc_handler> with the appropriate concurrency strategy. Default behavior is to activate the <svc_handler> as a "passive object." 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). |
|
Cancel a oneshot acceptor that was started asynchronously.
|
|
Close down the <oneshot_acceptor>.
|
|
Dump the state of an object.
|
|
Default version does no work and returns -1. Must be overloaded by application developer to do anything meaningful. Reimplemented from ACE_Shared_Object. |
|
Returns the listening acceptor's <ace_handle>.
Reimplemented from ACE_Event_Handler. |
|
Perform termination activities when <this> is removed from the <reactor>. Reimplemented from ACE_Event_Handler. |
|
Accept one connection from a client and activates the SVC_HANDLER. Reimplemented from ACE_Event_Handler. |
|
Called when an acceptor times out...
Reimplemented from ACE_Event_Handler. |
|
Default version returns address info in <buf>.
Reimplemented from ACE_Shared_Object. |
|
Default version does no work and returns -1. Must be overloaded by application developer to do anything meaningful. Reimplemented from ACE_Shared_Object. |
|
Initialize the appropriate strategies for concurrency and then open the <peer_acceptor> at the designated <local_addr>. Note that unlike the <ace_acceptor> and <ace_strategy_acceptor>, this method does NOT register <this> acceptor with the <reactor> at this point -- it just stashes the <reactor> away in case it's needed later. |
|
Return the underlying <peer_acceptor> object.
|
|
Insert ourselves into the <ace_reactor> so that we can continue accepting this connection asynchronously. This method should NOT be called by developers directly. |
|
Default version does no work and returns -1. Must be overloaded by application developer to do anything meaningful. Reimplemented from ACE_Service_Object. |
|
Factors out the code shared between the <accept> and <handle_input> methods. |
|
Default version does no work and returns -1. Must be overloaded by application developer to do anything meaningful. Reimplemented from ACE_Service_Object. |
|
Declare the dynamic allocation hooks.
|
|
Concurrency strategy for an Acceptor.
|
|
1 if Acceptor created the concurrency strategy and thus should delete it, else 0. |
|
Factory that establishes connections passively.
|
|
Hold the restart flag across asynchrony boundaries.
|
|
Hold the svc_handler_ across asynchrony boundaries.
|