summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Reference.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2009-03-12 10:26:37 +0100
committerBenoit Foucher <benoit@zeroc.com>2009-03-12 10:26:37 +0100
commit2f8ff1f01af2416dce3cda6c6093374d95fc453d (patch)
tree9392f8267b919d2a8974eb275515e0212f74deed /cpp/src/Ice/Reference.cpp
parentMerge branch 'R3_3_branch' of ssh://cvs.zeroc.com/home/git/ice into R3_3_branch (diff)
downloadice-2f8ff1f01af2416dce3cda6c6093374d95fc453d.tar.bz2
ice-2f8ff1f01af2416dce3cda6c6093374d95fc453d.tar.xz
ice-2f8ff1f01af2416dce3cda6c6093374d95fc453d.zip
- Fixed potential assert when establishing connection for proxies with
different endpoint combinations - Added test for connection establishment using proxies with different endpoint combination. - Improved connection establishment to better handle failures when many AMI requests (invoked on different proxies) are queued. The failure is now reported to all pending requests.
Diffstat (limited to 'cpp/src/Ice/Reference.cpp')
-rw-r--r--cpp/src/Ice/Reference.cpp94
1 files changed, 47 insertions, 47 deletions
diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp
index d3cc01479d6..29c177567c0 100644
--- a/cpp/src/Ice/Reference.cpp
+++ b/cpp/src/Ice/Reference.cpp
@@ -1678,29 +1678,29 @@ IceInternal::RoutableReference::createConnection(const vector<EndpointIPtr>& all
virtual void
setConnection(const Ice::ConnectionIPtr& connection, bool compress)
+ {
+ //
+ // If we have a router, set the object adapter for this router
+ // (if any) to the new connection, so that callbacks from the
+ // router can be received over this new connection.
+ //
+ if(_routerInfo && _routerInfo->getAdapter())
{
- //
- // If we have a router, set the object adapter for this router
- // (if any) to the new connection, so that callbacks from the
- // router can be received over this new connection.
- //
- if(_routerInfo && _routerInfo->getAdapter())
- {
- connection->setAdapter(_routerInfo->getAdapter());
- }
- _callback->setConnection(connection, compress);
+ connection->setAdapter(_routerInfo->getAdapter());
}
+ _callback->setConnection(connection, compress);
+ }
virtual void
setException(const Ice::LocalException& ex)
- {
- _callback->setException(ex);
- }
-
+ {
+ _callback->setException(ex);
+ }
+
CB1(const RouterInfoPtr& routerInfo, const GetConnectionCallbackPtr& callback) :
- _routerInfo(routerInfo), _callback(callback)
- {
- }
+ _routerInfo(routerInfo), _callback(callback)
+ {
+ }
private:
@@ -1723,49 +1723,49 @@ IceInternal::RoutableReference::createConnection(const vector<EndpointIPtr>& all
virtual void
setConnection(const Ice::ConnectionIPtr& connection, bool compress)
+ {
+ //
+ // If we have a router, set the object adapter for this router
+ // (if any) to the new connection, so that callbacks from the
+ // router can be received over this new connection.
+ //
+ if(_reference->getRouterInfo() && _reference->getRouterInfo()->getAdapter())
{
- //
- // If we have a router, set the object adapter for this router
- // (if any) to the new connection, so that callbacks from the
- // router can be received over this new connection.
- //
- if(_reference->getRouterInfo() && _reference->getRouterInfo()->getAdapter())
- {
- connection->setAdapter(_reference->getRouterInfo()->getAdapter());
- }
- _callback->setConnection(connection, compress);
+ connection->setAdapter(_reference->getRouterInfo()->getAdapter());
}
+ _callback->setConnection(connection, compress);
+ }
virtual void
setException(const Ice::LocalException& ex)
+ {
+ if(!_exception.get())
{
- if(!_exception.get())
- {
- _exception.reset(dynamic_cast<Ice::LocalException*>(ex.ice_clone()));
- }
-
- if(++_i == _endpoints.size())
- {
- _callback->setException(*_exception.get());
- return;
- }
-
- const bool more = _i != _endpoints.size() - 1;
- vector<EndpointIPtr> endpoint;
- endpoint.push_back(_endpoints[_i]);
-
- OutgoingConnectionFactoryPtr factory = _reference->getInstance()->outgoingConnectionFactory();
- factory->create(endpoint, more, _reference->getEndpointSelection(), this);
+ _exception.reset(dynamic_cast<Ice::LocalException*>(ex.ice_clone()));
}
-
+
+ if(++_i == _endpoints.size())
+ {
+ _callback->setException(*_exception.get());
+ return;
+ }
+
+ const bool more = _i != _endpoints.size() - 1;
+ vector<EndpointIPtr> endpoint;
+ endpoint.push_back(_endpoints[_i]);
+
+ OutgoingConnectionFactoryPtr factory = _reference->getInstance()->outgoingConnectionFactory();
+ factory->create(endpoint, more, _reference->getEndpointSelection(), this);
+ }
+
CB2(const RoutableReferencePtr& reference, const vector<EndpointIPtr>& endpoints,
const GetConnectionCallbackPtr& callback) :
_reference(reference),
_endpoints(endpoints),
_callback(callback),
_i(0)
- {
- }
+ {
+ }
private: