|
ACE version :
This is ACE version 5.4, released Wed Jan 14 18:45:46 2004.
Visual C++ version 6 SP3.
--- SAMPLE BEGIN ---
-
- #include <ace/Event_Handler.h>
- #include <ace/reactor.h>
- #include <ace/OS_NS_sys_time.h>
- struct Main : public ACE_Event_Handler
- {
- int _f;
- int _t1;
- Main() {_f = _t1 = 0;}
- init();
- virtual int handle_timeout(const ACE_Time_Value &tv, const void *arg);
- };
- Main::init()
- {
- _t1 = ACE_Reactor::instance()->schedule_timer(this, (void *) 1, 0, 1);
- }
- int Main::handle_timeout(const ACE_Time_Value &tv, const void *arg)
- {
- static int c = 0;
- printf("t\n");
- if (c++ == 3)
- _f = true;
- return 0;
- }
- int main(int argc, char* argv[])
- {
- Main m;
- m.init();
- while (!m._f)
- {
- ACE_Reactor::instance()->handle_events();
- }
- return 0;
- }
复制代码
--- SAMPLE END ---
ACE crahses after exiting main().
If someone could help ...
Thank you for advance. |
|