Abstract factory for creating a service handler (SVC_HANDLER), accepting into the SVC_HANDLER, and activating the SVC_HANDLER.
More...
|
| | ACE_Acceptor (ACE_Reactor *=0, int use_select=ACE_DEFAULT_ACCEPTOR_USE_SELECT) |
| | "Do-nothing" constructor.
|
| |
| | ACE_Acceptor (const typename PEER_ACCEPTOR::PEER_ADDR &local_addr, ACE_Reactor *reactor=ACE_Reactor::instance(), int flags=0, int use_select=ACE_DEFAULT_ACCEPTOR_USE_SELECT, int reuse_addr=1) |
| |
| virtual int | open (const typename PEER_ACCEPTOR::PEER_ADDR &local_addr, ACE_Reactor *reactor=ACE_Reactor::instance(), int flags=0, int use_select=ACE_DEFAULT_ACCEPTOR_USE_SELECT, int reuse_addr=1) |
| |
| virtual | ~ACE_Acceptor () |
| | Close down the Acceptor's resources.
|
| |
| virtual | operator PEER_ACCEPTOR & () const |
| | Return the underlying PEER_ACCEPTOR object.
|
| |
| virtual PEER_ACCEPTOR & | acceptor () const |
| | Return the underlying PEER_ACCEPTOR object.
|
| |
| virtual ACE_HANDLE | get_handle () const |
| | Returns the listening acceptor's {ACE_HANDLE}.
|
| |
| virtual int | close () |
| | Close down the Acceptor.
|
| |
| virtual int | handle_accept_error () |
| |
| void | dump () const |
| | Dump the state of an object.
|
| |
| virtual int | suspend () |
| | This method calls {Reactor::suspend}.
|
| |
| virtual int | resume () |
| | This method calls {Reactor::resume}.
|
| |
| | ACE_Service_Object (ACE_Reactor *=0) |
| | Constructor.
|
| |
| virtual | ~ACE_Service_Object () |
| | Destructor.
|
| |
| virtual | ~ACE_Event_Handler ()=default |
| | Destructor is virtual to enable proper cleanup.
|
| |
| virtual void | set_handle (ACE_HANDLE) |
| | Set the I/O handle.
|
| |
| virtual int | priority () const |
| |
| virtual void | priority (int priority) |
| | Set the priority of the Event_Handler.
|
| |
| virtual int | handle_output (ACE_HANDLE fd=ACE_INVALID_HANDLE) |
| |
| virtual int | handle_exception (ACE_HANDLE fd=ACE_INVALID_HANDLE) |
| | Called when an exceptional events occur (e.g., SIGURG).
|
| |
| virtual int | handle_timeout (const ACE_Time_Value ¤t_time, const void *act=0) |
| |
| virtual int | handle_exit (ACE_Process *) |
| | Called when a process exits.
|
| |
| virtual int | handle_signal (int signum, siginfo_t *=0, ucontext_t *=0) |
| |
| virtual int | resume_handler () |
| |
| virtual int | handle_qos (ACE_HANDLE=ACE_INVALID_HANDLE) |
| |
| virtual int | handle_group_qos (ACE_HANDLE=ACE_INVALID_HANDLE) |
| |
| virtual void | reactor (ACE_Reactor *reactor) |
| | Set the event demultiplexors.
|
| |
| virtual ACE_Reactor * | reactor () const |
| | Get the event demultiplexors.
|
| |
| virtual ACE_Reactor_Timer_Interface * | reactor_timer_interface () const |
| | Get only the reactor's timer related interface.
|
| |
| virtual Reference_Count | add_reference () |
| | Increment reference count on the handler.
|
| |
| virtual Reference_Count | remove_reference () |
| | Decrement reference count on the handler.
|
| |
| Reference_Counting_Policy & | reference_counting_policy () |
| | Current Reference_Counting_Policy.
|
| |
| | ACE_Shared_Object () |
| | Constructor.
|
| |
| virtual | ~ACE_Shared_Object () |
| | Destructor.
|
| |
Abstract factory for creating a service handler (SVC_HANDLER), accepting into the SVC_HANDLER, and activating the SVC_HANDLER.
Implements the basic strategy for passively establishing connections with clients. An ACE_Acceptor inherits from ACE_Service_Object, which in turn inherits from ACE_Event_Handler. This enables the ACE_Reactor to dispatch the ACE_Acceptor's handle_input method when connection events occur. The handle_input method performs the ACE_Acceptor's default creation, connection establishment, and service activation strategies. These strategies can be overridden by subclasses individually or as a group.
An ACE_Acceptor is parameterized by concrete types that conform to the interfaces of SVC_HANDLER and PEER_ACCEPTOR described below.
- Template Parameters
-
| SVC_HANDLER | The name of the concrete type that performs the application-specific service. The SVC_HANDLER typically inherits from ACE_Svc_Handler. |
- See also
- Svc_Handler.h.
- Template Parameters
-
| PEER_ACCEPTOR | The name of the class that implements the PEER_ACCEPTOR endpoint (e.g., ACE_SOCK_Acceptor) to passively establish connections. A PEER_ACCEPTOR implementation must provide a PEER_STREAM and PEER_ADDR trait to identify the type of stream (e.g., ACE_SOCK_Stream) and type of address (e.g., ACE_INET_Addr) used by the endpoint. |
Open the contained PEER_ACCEPTOR object to begin listening, and register with the specified reactor for accept events. An acceptor can only listen to one port at a time, so make sure to close() the acceptor before calling open() again.
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.
- Parameters
-
| 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, instead 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. |
Open the contained PEER_ACCEPTOR object to begin listening, and register with the specified reactor for accept events. An acceptor can only listen to one port at a time, so make sure to close() the acceptor before calling open() again.
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.
- Parameters
-
| 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, instead 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. |
- Return values
-
| 0 | Success |
| -1 | Failure, errno contains an error code. |
Reimplemented in ACE_Strategy_Acceptor< SVC_HANDLER, PEER_ACCEPTOR >.