summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-12-28 19:59:46 +0000
committernanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-12-28 19:59:46 +0000
commitce232b92f6bef80a53cf90cedbce7b854bca1b60 (patch)
tree4244d9288ce746df22198de0c9f67f1453266b46
parent2912409347982e54563f8120d6923384c65d8c44 (diff)
downloadATCD-ce232b92f6bef80a53cf90cedbce7b854bca1b60.tar.gz
*** empty log message ***
-rw-r--r--TAO/tao/Strategies/SHMIOP_Transport.cpp47
1 files changed, 26 insertions, 21 deletions
diff --git a/TAO/tao/Strategies/SHMIOP_Transport.cpp b/TAO/tao/Strategies/SHMIOP_Transport.cpp
index e87b624752e..2e48ec4e8e7 100644
--- a/TAO/tao/Strategies/SHMIOP_Transport.cpp
+++ b/TAO/tao/Strategies/SHMIOP_Transport.cpp
@@ -105,36 +105,41 @@ TAO_SHMIOP_Transport::recv_i (char *buf,
size_t len,
const ACE_Time_Value *max_wait_time)
{
- ssize_t n = this->connection_handler_->peer ().recv (buf,
- len,
- max_wait_time);
-
- // Most of the errors handling is common for
- // Now the message has been read
- if (n == -1 &&
- TAO_debug_level > 4 &&
- errno != ETIME)
+ ssize_t n = 0;
+
+ int read_break = 0;
+
+ while (!read_break)
{
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("TAO (%P|%t) - %p \n"),
- ACE_TEXT ("TAO - read message failure ")
- ACE_TEXT ("recv_i () \n")));
+ n = this->connection_handler_->peer ().recv (buf,
+ len,
+ max_wait_time);
+
+ // If we get a EWOULBLOCK we try to read again.
+ if (n == -1 && (errno == EAGAIN || errno == EWOULDBLOCK))
+ {
+ n = 0;
+ continue;
+ }
+
+ // If there is anything else we just drop out of the loop.
+ read_break = 1;
}
- // Error handling
if (n == -1)
{
- if (errno == EWOULDBLOCK)
- return 0;
-
- return -1;
+ if (TAO_debug_level > 3 && errno != ETIME)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - %p \n"),
+ ACE_TEXT ("TAO - read message failure ")
+ ACE_TEXT ("recv_i () \n")));
+ }
}
- // @@ What are the other error handling here??
else if (n == 0)
{
- return -1;
+ n = -1;
}
-
return n;
}