2
** Logging_Event_Handler_Ex.h,v 1.4 2003/08/04 03:53:54 dhinton Exp
4
** Copyright 2002 Addison Wesley. All Rights Reserved.
7
#ifndef _LOGGING_EVENT_HANDLER_EX_H
8
#define _LOGGING_EVENT_HANDLER_EX_H
10
#include "ace/Reactor.h"
11
#include "ace/Time_Value.h"
12
#include "ace/Recursive_Thread_Mutex.h"
14
#include "Logging_Event_Handler.h"
16
class Logging_Event_Handler_Ex : public Logging_Event_Handler
19
// Time when a client last sent a log record.
20
ACE_Time_Value time_of_last_log_record_;
22
// Maximum time to wait for a client log record.
23
const ACE_Time_Value max_client_timeout_;
26
typedef Logging_Event_Handler PARENT;
28
// 3600 seconds == one hour.
29
enum { MAX_CLIENT_TIMEOUT = 3600 };
31
Logging_Event_Handler_Ex
32
(ACE_Reactor *reactor,
33
const ACE_Time_Value &max_client_timeout
34
= ACE_Time_Value (MAX_CLIENT_TIMEOUT))
35
: Logging_Event_Handler (reactor),
36
time_of_last_log_record_ (0),
37
max_client_timeout_ (max_client_timeout) {}
39
virtual ~Logging_Event_Handler_Ex () {}
41
virtual int open (); // Activate the event handler.
43
// Called by a reactor when logging events arrive.
44
virtual int handle_input (ACE_HANDLE);
46
// Called when a timeout expires to check if the client has
47
// been idle for an excessive amount of time.
48
virtual int handle_timeout (const ACE_Time_Value &tv,
51
// Called when this object is destroyed, e.g., when it's
52
// removed from a reactor.
53
virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE,
54
ACE_Reactor_Mask = 0);
57
#endif /* _LOGGING_EVENT_HANDLER_EX_H */