diff options
author | bala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-09-05 17:59:44 +0000 |
---|---|---|
committer | bala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-09-05 17:59:44 +0000 |
commit | 23c70e00d7fd4a2029ad3ad9341bbc545568f111 (patch) | |
tree | 2cfd00dd8d517f4a4840cb663734fcb00ae8ca4b /TAO/tao | |
parent | 1a9d4529aa7931c394852fba6484a1419d585410 (diff) | |
download | ATCD-23c70e00d7fd4a2029ad3ad9341bbc545568f111.tar.gz |
ChangeLogTag: Wed Sep 5 12:35:33 2001 Balachandran Natarajan <bala@cs.wustl.edu>
Diffstat (limited to 'TAO/tao')
-rw-r--r-- | TAO/tao/Endpoint.h | 12 | ||||
-rw-r--r-- | TAO/tao/IIOP_Endpoint.i | 35 | ||||
-rw-r--r-- | TAO/tao/IIOP_Transport.cpp | 13 | ||||
-rw-r--r-- | TAO/tao/Strategies/DIOP_Endpoint.i | 35 | ||||
-rw-r--r-- | TAO/tao/Strategies/SHMIOP_Endpoint.i | 10 | ||||
-rw-r--r-- | TAO/tao/Strategies/SHMIOP_Transport.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/Strategies/UIOP_Transport.cpp | 4 |
7 files changed, 77 insertions, 34 deletions
diff --git a/TAO/tao/Endpoint.h b/TAO/tao/Endpoint.h index e5602a279ca..82c4f13092c 100644 --- a/TAO/tao/Endpoint.h +++ b/TAO/tao/Endpoint.h @@ -86,6 +86,16 @@ public: /// Return a hash value for this object. virtual CORBA::ULong hash (void) = 0; + +protected: + + /// Lock for the address lookup. + /// @@todo: This lock should be strategised so that we dont lock in + /// single threaded configurations. I am not able to do this now as + /// most of the information is available in the ORB_Core which is + /// not available here... + TAO_SYNCH_MUTEX addr_lookup_lock_; + private: // Endpoints should not be copied. @@ -102,6 +112,8 @@ private: * currently used for RTCORBA only. */ CORBA::Short priority_; + + }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/IIOP_Endpoint.i b/TAO/tao/IIOP_Endpoint.i index ac5c2b8415b..8e478b7da04 100644 --- a/TAO/tao/IIOP_Endpoint.i +++ b/TAO/tao/IIOP_Endpoint.i @@ -16,20 +16,27 @@ TAO_IIOP_Endpoint::object_addr (void) const ACE_const_cast (TAO_IIOP_Endpoint *, this); - if (this->object_addr_.get_type () != AF_INET - && endpoint->object_addr_.set (this->port_, - this->host_.in ()) == -1) - { - // If this call fails, it most likely due a hostname lookup - // failure caused by a DNS misconfiguration. If a request is - // made to the object at the given host and port, then a - // CORBA::TRANSIENT() exception should be thrown. - - // Invalidate the ACE_INET_Addr. This is used as a flag to - // denote that ACE_INET_Addr initialization failed. - endpoint->object_addr_.set_type (-1); - } - + // Begin a dummy scope for the lock + { + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, + guard, + endpoint->addr_lookup_lock_, + this->object_addr_ ); + + if (this->object_addr_.get_type () != AF_INET + && endpoint->object_addr_.set (this->port_, + this->host_.in ()) == -1) + { + // If this call fails, it most likely due a hostname lookup + // failure caused by a DNS misconfiguration. If a request is + // made to the object at the given host and port, then a + // CORBA::TRANSIENT() exception should be thrown. + + // Invalidate the ACE_INET_Addr. This is used as a flag to + // denote that ACE_INET_Addr initialization failed. + endpoint->object_addr_.set_type (-1); + } + } return this->object_addr_; } diff --git a/TAO/tao/IIOP_Transport.cpp b/TAO/tao/IIOP_Transport.cpp index 85e5f4b1d84..46d339d8c9e 100644 --- a/TAO/tao/IIOP_Transport.cpp +++ b/TAO/tao/IIOP_Transport.cpp @@ -85,9 +85,11 @@ TAO_IIOP_Transport::recv_i (char *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) + // Do not print the error message if it is a timeout, which could + // occur in thread-per-connection. + if (n == -1 && + TAO_debug_level > 4 && + errno != ETIME) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TAO (%P|%t) - %p \n"), @@ -101,8 +103,13 @@ TAO_IIOP_Transport::recv_i (char *buf, if (errno == EWOULDBLOCK) return 0; + return -1; } + + // Most of the errors handling is common for + // Now the message has been read + // @@ What are the other error handling here?? else if (n == 0) { diff --git a/TAO/tao/Strategies/DIOP_Endpoint.i b/TAO/tao/Strategies/DIOP_Endpoint.i index ad9b9d97a30..b3489cbc445 100644 --- a/TAO/tao/Strategies/DIOP_Endpoint.i +++ b/TAO/tao/Strategies/DIOP_Endpoint.i @@ -16,20 +16,27 @@ TAO_DIOP_Endpoint::object_addr (void) const ACE_const_cast (TAO_DIOP_Endpoint *, this); - if (this->object_addr_.get_type () != AF_INET - && endpoint->object_addr_.set (this->port_, - this->host_.in ()) == -1) - { - // If this call fails, it most likely due a hostname lookup - // failure caused by a DNS misconfiguration. If a request is - // made to the object at the given host and port, then a - // CORBA::TRANSIENT() exception should be thrown. - - // Invalidate the ACE_INET_Addr. This is used as a flag to - // denote that ACE_INET_Addr initialization failed. - endpoint->object_addr_.set_type (-1); - } - + // Begin artificial scoping here.. + { + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, + guard, + endpoint->addr_lookup_lock_, + this->object_addr_ ); + + if (this->object_addr_.get_type () != AF_INET + && endpoint->object_addr_.set (this->port_, + this->host_.in ()) == -1) + { + // If this call fails, it most likely due a hostname lookup + // failure caused by a DNS misconfiguration. If a request is + // made to the object at the given host and port, then a + // CORBA::TRANSIENT() exception should be thrown. + + // Invalidate the ACE_INET_Addr. This is used as a flag to + // denote that ACE_INET_Addr initialization failed. + endpoint->object_addr_.set_type (-1); + } + } return this->object_addr_; } diff --git a/TAO/tao/Strategies/SHMIOP_Endpoint.i b/TAO/tao/Strategies/SHMIOP_Endpoint.i index b09a0ea3fb5..9319b0cdfc0 100644 --- a/TAO/tao/Strategies/SHMIOP_Endpoint.i +++ b/TAO/tao/Strategies/SHMIOP_Endpoint.i @@ -16,7 +16,14 @@ TAO_SHMIOP_Endpoint::object_addr (void) const ACE_const_cast (TAO_SHMIOP_Endpoint *, this); - if (this->object_addr_.get_type () != AF_INET + // Begin a dummy scope for the lock + { + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, + guard, + endpoint->addr_lookup_lock_, + this->object_addr_ ); + + if (this->object_addr_.get_type () != AF_INET && endpoint->object_addr_.set (this->port_, this->host_.in ()) == -1) { @@ -29,6 +36,7 @@ TAO_SHMIOP_Endpoint::object_addr (void) const // denote that ACE_INET_Addr initialization failed. endpoint->object_addr_.set_type (-1); } + } return this->object_addr_; } diff --git a/TAO/tao/Strategies/SHMIOP_Transport.cpp b/TAO/tao/Strategies/SHMIOP_Transport.cpp index 6cd79c5620f..64fbe74061f 100644 --- a/TAO/tao/Strategies/SHMIOP_Transport.cpp +++ b/TAO/tao/Strategies/SHMIOP_Transport.cpp @@ -115,7 +115,7 @@ TAO_SHMIOP_Transport::recv_i (char *buf, if (n == 0 || n == -1) { - if (TAO_debug_level > 3) + if (TAO_debug_level > 3 && errno != ETIME) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TAO (%P|%t) - %p \n"), diff --git a/TAO/tao/Strategies/UIOP_Transport.cpp b/TAO/tao/Strategies/UIOP_Transport.cpp index 2baf994c1ac..f31de7af50f 100644 --- a/TAO/tao/Strategies/UIOP_Transport.cpp +++ b/TAO/tao/Strategies/UIOP_Transport.cpp @@ -88,7 +88,9 @@ TAO_UIOP_Transport::recv_i (char *buf, // Most of the errors handling is common for // Now the message has been read - if (n == -1 && TAO_debug_level > 4) + if (n == -1 && + TAO_debug_level > 4 && + errno != ETIME) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TAO (%P|%t) - %p \n"), |