#include <ace/Acceptor.h>
template<class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> class ACE_Acceptor : public ACE_Service_Object {
public:ACE_Acceptor (ACE_Reactor * = 0, int use_select = 1);ACE_Acceptor ( const ACE_PEER_ACCEPTOR_ADDR &local_addr, ACE_Reactor * = ACE_Reactor::instance (), int flags = 0, int use_select = 1, int reuse_addr = 1 );int open ( const ACE_PEER_ACCEPTOR_ADDR &, ACE_Reactor * = ACE_Reactor::instance (), int flags = 0, int use_select = 1, int reuse_addr = 1 );virtual ~ACE_Acceptor (void);virtual operator ACE_PEER_ACCEPTOR &() const;virtual ACE_PEER_ACCEPTOR &acceptor (void) const;virtual ACE_HANDLE get_handle (void) const;virtual int close (void);void dump (void) const;ACE_ALLOC_HOOK_DECLARE;protected:virtual int make_svc_handler (SVC_HANDLER *&sh);virtual int accept_svc_handler (SVC_HANDLER *svc_handler);virtual int activate_svc_handler (SVC_HANDLER *svc_handler);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 init (int argc, ASYS_TCHAR *argv[]);virtual int fini (void);virtual int info (ASYS_TCHAR **buf, size_t) const;virtual int suspend (void);virtual int resume (void);ACE_PEER_ACCEPTOR peer_acceptor_;int flags_;int use_select_;};
ACE_Acceptor (ACE_Reactor * = 0, int use_select = 1);
ACE_Acceptor (
const ACE_PEER_ACCEPTOR_ADDR &local_addr,
ACE_Reactor * = ACE_Reactor::instance (),
int flags = 0,
int use_select = 1,
int reuse_addr = 1
);
this with the Reactor and listen for
connection requests at the designated local_addr. flags
indicates how SVC_HANDLER's should be initialized prior to
being activated. Right now, the only flag that is processed is
ACE_NONBLOCK, which enabled non-blocking I/O on the
SVC_HANDLER when it is opened. If use_select is non-zero
then select is used to determine when to break out of the
accept loop. reuse_addr is passed down to the
PEER_ACCEPTOR. If it is non-zero this will allow the OS to
reuse this listen port.
int open (
const ACE_PEER_ACCEPTOR_ADDR &,
ACE_Reactor * = ACE_Reactor::instance (),
int flags = 0,
int use_select = 1,
int reuse_addr = 1
);
this with the Reactor and listen for
connection requests at the designated local_addr. flags
indicates how SVC_HANDLER's should be initialized prior to
being activated. Right now, the only flag that is processed is
ACE_NONBLOCK, which enabled non-blocking I/O on the
SVC_HANDLER when it is opened. If use_select is non-zero
then select is used to determine when to break out of the
accept loop. reuse_addr is passed down to the
PEER_ACCEPTOR. If it is non-zero this will allow the OS to
reuse this listen port.
virtual ~ACE_Acceptor (void);
virtual operator ACE_PEER_ACCEPTOR &() const;
virtual ACE_PEER_ACCEPTOR &acceptor (void) const;
virtual ACE_HANDLE get_handle (void) const;
ACE_HANDLE.
virtual int close (void);
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;
virtual int make_svc_handler (SVC_HANDLER *&sh);
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.
virtual int accept_svc_handler (SVC_HANDLER *svc_handler);
svc_handler. The default behavior delegates to the
PEER_ACCEPTOR::accept.
virtual int activate_svc_handler (SVC_HANDLER *svc_handler);
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 making the
SVC_HANDLER as an "active object" via multi-threading or
multi-processing).
virtual int handle_close (
ACE_HANDLE = ACE_INVALID_HANDLE,
ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK
);
this is removed from the
reactor.
virtual int handle_input (ACE_HANDLE);
virtual int init (int argc, ASYS_TCHAR *argv[]);
virtual int fini (void);
handle_close.
virtual int info (ASYS_TCHAR **buf, size_t) const;
buf.
virtual int suspend (void);
Reactor::suspend.
virtual int resume (void);
Reactor::resume.