diff options
Diffstat (limited to 'tests/Thread_Pool_Reactor_Test.cpp')
-rw-r--r-- | tests/Thread_Pool_Reactor_Test.cpp | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/tests/Thread_Pool_Reactor_Test.cpp b/tests/Thread_Pool_Reactor_Test.cpp index 4c57055c0f4..b072a8f1c04 100644 --- a/tests/Thread_Pool_Reactor_Test.cpp +++ b/tests/Thread_Pool_Reactor_Test.cpp @@ -137,7 +137,7 @@ Request_Handler::handle_input (ACE_HANDLE fd) ssize_t result = this->peer ().recv (&len, sizeof (ACE_TCHAR)); if (result > 0 - && this->peer ().recv_n (buffer, len * sizeof (ACE_TCHAR)) + && this->peer ().recv_n (buffer, len * sizeof (ACE_TCHAR)) == ACE_static_cast (ssize_t, len * sizeof (ACE_TCHAR))) { ++this->nr_msgs_rcvd_; @@ -168,37 +168,30 @@ Request_Handler::handle_close (ACE_HANDLE fd, ACE_Reactor_Mask) ACE_ERROR((LM_ERROR, "(%t) Handler 0x%x: Expected %d messages; got %d\n", this, - cli_req_no, + cli_req_no, this->nr_msgs_rcvd_)); this->destroy (); return 0; } -static int -reactor_event_hook (void *) -{ - ACE_DEBUG ((LM_DEBUG, - "(%t) handling events ....\n")); - - return 0; -} - static void * svr_worker (void *) { // Server thread function. - int result = - ACE_Reactor::instance ()->run_reactor_event_loop (&reactor_event_hook); - if (result == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "(%t) %p\n", - "Error handling events"), - 0); + while (!ACE_Reactor::event_loop_done ()) + { + ACE_DEBUG ((LM_DEBUG, + "(%t) handling events ....\n")); + + if (ACE_Reactor::instance ()->handle_events () == -1) + ACE_ERROR ((LM_ERROR, + "(%t) %p\n", + "Error handling events")); + } ACE_DEBUG ((LM_DEBUG, "(%t) I am done handling events. Bye, bye\n")); - return 0; } @@ -349,7 +342,7 @@ main (int, ACE_TCHAR *[]) { ACE_START_TEST (ACE_TEXT ("Thread_Pool_Reactor_Test")); - ACE_ERROR ((LM_INFO, + ACE_ERROR ((LM_INFO, "threads not supported on this platform\n")); ACE_END_TEST; |