summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/RouterInfo.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2004-10-21 18:58:04 +0000
committerMarc Laukien <marc@zeroc.com>2004-10-21 18:58:04 +0000
commit80d153dcde86a890fc63c147ac47dabb6af91570 (patch)
treee5eb53835dda09f97c8b04eb294792bb56b6f4e4 /cpp/src/Ice/RouterInfo.cpp
parentdemo build.xml now use Ice.jar (and db.jar if present), which is more (diff)
downloadice-80d153dcde86a890fc63c147ac47dabb6af91570.tar.bz2
ice-80d153dcde86a890fc63c147ac47dabb6af91570.tar.xz
ice-80d153dcde86a890fc63c147ac47dabb6af91570.zip
timeout for clientProxy / ice_connection
Diffstat (limited to 'cpp/src/Ice/RouterInfo.cpp')
-rw-r--r--cpp/src/Ice/RouterInfo.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/cpp/src/Ice/RouterInfo.cpp b/cpp/src/Ice/RouterInfo.cpp
index 41c3f3b4892..6ac35188cc3 100644
--- a/cpp/src/Ice/RouterInfo.cpp
+++ b/cpp/src/Ice/RouterInfo.cpp
@@ -11,6 +11,7 @@
#include <Ice/Router.h>
#include <Ice/RoutingTable.h>
#include <Ice/LocalException.h>
+#include <Ice/Connection.h> // For ice_connection()->timeout().
#include <Ice/Functional.h>
using namespace std;
@@ -135,7 +136,15 @@ IceInternal::RouterInfo::getClientProxy()
{
throw NoEndpointException(__FILE__, __LINE__);
}
+
_clientProxy = _clientProxy->ice_router(0); // The client proxy cannot be routed.
+
+ //
+ // In order to avoid creating a new connection to the router,
+ // we must use the same timeout as the already existing
+ // connection.
+ //
+ _clientProxy = _clientProxy->ice_timeout(_router->ice_connection()->timeout());
}
return _clientProxy;
@@ -145,7 +154,14 @@ void
IceInternal::RouterInfo::setClientProxy(const ObjectPrx& clientProxy)
{
IceUtil::Mutex::Lock sync(*this);
+
_clientProxy = clientProxy->ice_router(0); // The client proxy cannot be routed.
+
+ //
+ // In order to avoid creating a new connection to the router, we
+ // must use the same timeout as the already existing connection.
+ //
+ _clientProxy = _clientProxy->ice_timeout(_router->ice_connection()->timeout());
}
ObjectPrx
@@ -160,6 +176,7 @@ IceInternal::RouterInfo::getServerProxy()
{
throw NoEndpointException(__FILE__, __LINE__);
}
+
_serverProxy = _serverProxy->ice_router(0); // The server proxy cannot be routed.
}
@@ -170,6 +187,7 @@ void
IceInternal::RouterInfo::setServerProxy(const ObjectPrx& serverProxy)
{
IceUtil::Mutex::Lock sync(*this);
+
_serverProxy = serverProxy->ice_router(0); // The server proxy cannot be routed.
}