From 492207f8d6bc0af6d8281126c38c7081b2d10564 Mon Sep 17 00:00:00 2001 From: bala Date: Sun, 6 May 2001 15:34:59 +0000 Subject: ChangeLogTag: Sun May 6 10:02:08 2001 Balachandran Natarajan --- TAO/tao/Wait_On_Read.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'TAO/tao/Wait_On_Read.cpp') diff --git a/TAO/tao/Wait_On_Read.cpp b/TAO/tao/Wait_On_Read.cpp index 4e73325944a..3320298e49d 100644 --- a/TAO/tao/Wait_On_Read.cpp +++ b/TAO/tao/Wait_On_Read.cpp @@ -22,16 +22,32 @@ TAO_Wait_On_Read::wait (ACE_Time_Value * max_wait_time, int &reply_received) { reply_received = 0; - while (reply_received == 0) + + // Do the same sort of looping that is done in other wait + // strategies. + int retval = 0; + while (1) { - reply_received = + retval = this->transport_->read_process_message (max_wait_time, 1); + + // If we got our reply, no need to run the loop any + // further. + if (reply_received) + break; + + // @@ We are not checking for timeouts here... + + // If we got an error just break + if (retval == -1) + break; } - if (reply_received == -1) + if (reply_received == -1 || retval == -1) { this->transport_->close_connection (); } + return (reply_received == 1 ? 0 : reply_received); } -- cgit v1.2.1