2 ** Copyright 2002 Addison Wesley. All Rights Reserved.
5 #ifndef _LOGGING_ACCEPTOR_H
6 #define _LOGGING_ACCEPTOR_H
8 #include "ace/Event_Handler.h"
9 #include "ace/INET_Addr.h"
10 #include "ace/Log_Record.h"
11 #include "ace/Reactor.h"
12 #include "ace/SOCK_Acceptor.h"
13 #include "ace/SOCK_Stream.h"
14 #include "Logging_Handler.h"
16 class Logging_Acceptor
: public ACE_Event_Handler
19 // Factory that connects <ACE_SOCK_Stream>s passively.
20 ACE_SOCK_Acceptor acceptor_
;
23 virtual ~Logging_Acceptor () {}; // No-op destructor.
26 typedef ACE_INET_Addr PEER_ADDR
;
28 // Simple constructor.
29 Logging_Acceptor (ACE_Reactor
*r
= ACE_Reactor::instance ())
30 : ACE_Event_Handler (r
) {};
32 // Initialization method.
33 virtual int open (const ACE_INET_Addr
&local_addr
);
35 // Called by a reactor when there's a new connection to accept.
36 virtual int handle_input (ACE_HANDLE
= ACE_INVALID_HANDLE
);
38 // Called when this object is destroyed, e.g., when it's
39 // removed from a reactor.
40 virtual int handle_close (ACE_HANDLE
= ACE_INVALID_HANDLE
,
41 ACE_Reactor_Mask
= 0);
43 // Return the passive-mode socket's I/O handle.
44 virtual ACE_HANDLE
get_handle () const
45 { return acceptor_
.get_handle (); };
47 // Returns a reference to the underlying <acceptor_>.
48 ACE_SOCK_Acceptor
&acceptor () { return acceptor_
; };
51 #endif /* _LOGGING_ACCEPTOR_H */