2 ** Copyright 2001 Addison Wesley. All Rights Reserved.
5 #ifndef _LOGGING_SERVER_H
6 #define _LOGGING_SERVER_H
8 #include "ace/FILE_IO.h"
9 #include "ace/SOCK_Acceptor.h"
11 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
12 class ACE_SOCK_Stream
;
13 ACE_END_VERSIONED_NAMESPACE_DECL
18 // Template Method that runs logging server's event loop.
19 virtual int run (int argc
, char *argv
[]);
22 // The following four methods are ``hooks'' that can be
23 // overridden by subclasses.
24 virtual int open (u_short port
= 0);
25 virtual int wait_for_multiple_events () { return 0; }
26 virtual int handle_connections () = 0;
27 virtual int handle_data (ACE_SOCK_Stream
* = 0) = 0;
29 // The following helper method can be used by the hook methods.
30 int make_log_file (ACE_FILE_IO
&, ACE_SOCK_Stream
* = 0);
32 // Close the socket endpoint.
33 virtual ~Logging_Server () { acceptor_
.close (); }
36 ACE_SOCK_Acceptor
&acceptor () { return acceptor_
; }
39 ACE_SOCK_Acceptor acceptor_
; // Socket acceptor endpoint.
42 #endif /* _LOGGING_SERVER_H */