2 ** Copyright 2001 Addison Wesley. All Rights Reserved.
5 #ifndef _THREAD_PER_CONNECTION_LOGGING_SERVER_H
6 #define _THREAD_PER_CONNECTION_LOGGING_SERVER_H
8 #include "ace/SOCK_Stream.h"
9 #include "Logging_Server.h"
11 class Thread_Per_Connection_Logging_Server
: public Logging_Server
15 Thread_Args (Thread_Per_Connection_Logging_Server
*lsp
) : this_ (lsp
) {}
17 Thread_Per_Connection_Logging_Server
*this_
;
18 ACE_SOCK_Stream logging_peer_
;
21 // Passed as a parameter to <ACE_Thread_Manager::spawn>.
22 static ACE_THR_FUNC_RETURN
run_svc (void *arg
);
25 virtual int handle_connections ();
26 virtual int handle_data (ACE_SOCK_Stream
* = 0);
29 // Template Method that runs logging server's event loop. Need to
30 // reimplement this here because the threads spawned from handle_connections
31 // call handle_data; therefore, this method must not.
32 virtual int run (int argc
, char *argv
[]) {
33 if (open (argc
> 1 ? atoi (argv
[1]) : 0) == -1)
37 if (wait_for_multiple_events () == -1)
39 if (handle_connections () == -1)
43 ACE_NOTREACHED (return 0;)
47 #endif /* _THREAD_PER_CONNECTION_LOGGING_SERVER_H */