2 ** Copyright 2002 Addison Wesley. All Rights Reserved.
5 #include "Logging_Event_Handler_Ex.h"
6 #include "ace/Timer_Queue.h"
8 int Logging_Event_Handler_Ex::handle_input (ACE_HANDLE h
) {
9 time_of_last_log_record_
=
10 reactor ()->timer_queue ()->gettimeofday ();
11 return PARENT::handle_input (h
);
14 int Logging_Event_Handler_Ex::open () {
15 int result
= PARENT::open ();
17 ACE_Time_Value
reschedule (max_client_timeout_
.sec () / 4);
19 reactor ()->schedule_timer
22 max_client_timeout_
, // Initial timeout.
23 reschedule
); // Subsequent timeouts.
28 int Logging_Event_Handler_Ex::handle_timeout
29 (const ACE_Time_Value
&now
, const void *) {
30 if (now
- time_of_last_log_record_
>= max_client_timeout_
)
31 reactor ()->remove_handler (this, ACE_Event_Handler::READ_MASK
);
35 int Logging_Event_Handler_Ex::handle_close (ACE_HANDLE
,
37 reactor ()->cancel_timer (this);
38 return PARENT::handle_close ();