diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-01-01 08:00:34 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-01-01 08:00:34 +0000 |
commit | 437eea6fa08e931864f89be91d14a816f69075c7 (patch) | |
tree | b8c1fd723fdcd61c3855d3a3a21a9cd45a268219 /examples/Reactor/WFMO_Reactor/test_timeout.cpp | |
parent | ea0d28240863caf437a18071bfd03e7b146c5ade (diff) | |
download | ATCD-unlabeled-4.2.2.tar.gz |
This commit was manufactured by cvs2svn to create branchunlabeled-4.2.2
'unlabeled-4.2.2'.
Diffstat (limited to 'examples/Reactor/WFMO_Reactor/test_timeout.cpp')
-rw-r--r-- | examples/Reactor/WFMO_Reactor/test_timeout.cpp | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/examples/Reactor/WFMO_Reactor/test_timeout.cpp b/examples/Reactor/WFMO_Reactor/test_timeout.cpp deleted file mode 100644 index 44871a2db2d..00000000000 --- a/examples/Reactor/WFMO_Reactor/test_timeout.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// ============================================================================ -// $Id: test_timeout.cpp - -// -// = LIBRARY -// examples -// -// = FILENAME -// test_timeout.cpp -// -// = DESCRIPTION -// This example application shows how to write ReactorEx and -// Proactor event loops that handle events for some fixed amount of -// time. -// -// = AUTHOR -// Tim Harrison -// -// ============================================================================ - -#include "ace/ReactorEx.h" -#include "ace/Proactor.h" -#include "ace/Time_Value.h" -#include "ace/Service_Config.h" -#include "ace/OS.h" - -class Timeout_Handler : public ACE_Event_Handler -// = TITLE -// Generic timeout handler. -{ -public: - Timeout_Handler (void) : count_ (0) {;} - - virtual int handle_timeout (const ACE_Time_Value &tv, - const void *arg) - // Print out when timeouts occur. - { - ACE_DEBUG ((LM_DEBUG, "%d timeout occurred for %s.\n", - ++count_, - (char *) arg)); - return 0; - } - -private: - int count_; -}; - -int -main () -{ - Timeout_Handler handler; - - // Register a 2 second timer. - ACE_Time_Value foo_tv (2); - ACE_Service_Config::reactorEx ()->schedule_timer (&handler, - (void *) "Foo", - ACE_Time_Value::zero, - foo_tv); - // Register a 3 second timer. - ACE_Time_Value bar_tv (3); - ACE_Service_Config::reactorEx ()->schedule_timer (&handler, - (void *) "Bar", - ACE_Time_Value::zero, - bar_tv); - - // Handle events for 12 seconds. - ACE_Time_Value run_time (12); - if (ACE_Service_Config::run_reactorEx_event_loop (run_time) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", "main"), -1); - - return 0; -} |