Created
September 18, 2012 15:12
-
-
Save yifu/3743677 to your computer and use it in GitHub Desktop.
ACE tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <ace/Reactor.h> | |
| #include <iostream> | |
| using namespace std; | |
| // -------------------------------------------------- | |
| // The goal is testing the shedule_timer() function | |
| // correctly triggers an event. | |
| // -------------------------------------------------- | |
| // ------------------------------------------- | |
| struct test_handler : public ACE_Event_Handler | |
| { | |
| int handle_timeout(const ACE_Time_Value& current_time, const void* act = 0); | |
| }; | |
| // ------------------------------------------- | |
| int test_handler::handle_timeout(const ACE_Time_Value& current_time, const void* act) | |
| { | |
| cout << "here" << endl; | |
| } | |
| // ------------------------------------------- | |
| int main() | |
| { | |
| test_handler handler; | |
| ACE_Time_Value delay(2); | |
| ACE_Reactor::instance()->schedule_timer(&handler, (void *)0/*arg*/, delay, ACE_Time_Value(0)); | |
| return ACE_Reactor::instance()->run_event_loop(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment