diff options
author | Marc Laukien <marc@zeroc.com> | 2004-02-17 04:08:42 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2004-02-17 04:08:42 +0000 |
commit | 67a17cb766ae2af0c633e3442c0c00dc3d8ed150 (patch) | |
tree | f060860e9e638693299d83dfee1e5830148ca6fd /cpp/src/Ice/OutgoingAsync.cpp | |
parent | more and more AMI fixes.. (diff) | |
download | ice-67a17cb766ae2af0c633e3442c0c00dc3d8ed150.tar.bz2 ice-67a17cb766ae2af0c633e3442c0c00dc3d8ed150.tar.xz ice-67a17cb766ae2af0c633e3442c0c00dc3d8ed150.zip |
more ami
Diffstat (limited to 'cpp/src/Ice/OutgoingAsync.cpp')
-rw-r--r-- | cpp/src/Ice/OutgoingAsync.cpp | 66 |
1 files changed, 56 insertions, 10 deletions
diff --git a/cpp/src/Ice/OutgoingAsync.cpp b/cpp/src/Ice/OutgoingAsync.cpp index 58b31d02626..b1ba114f417 100644 --- a/cpp/src/Ice/OutgoingAsync.cpp +++ b/cpp/src/Ice/OutgoingAsync.cpp @@ -155,24 +155,61 @@ IceInternal::OutgoingAsync::__finished(BasicStream& is) void IceInternal::OutgoingAsync::__finished(const LocalException& exc) { - try + bool retry = false; + + if(_reference->locatorInfo) { - ice_exception(exc); + _reference->locatorInfo->clearObjectCache(_reference); } - catch(const Exception& ex) + + if(dynamic_cast<const CloseConnectionException*>(&exc)) { - warning(ex); + try + { + ProxyFactoryPtr proxyFactory = _reference->instance->proxyFactory(); + if(proxyFactory) + { + proxyFactory->checkRetryAfterException(exc, _cnt); + } + else + { + exc.ice_throw(); // The communicator is already destroyed, so we cannot retry. + } + + retry = true; + } + catch(const LocalException&) + { + } } - catch(const std::exception& ex) + + if(retry) { - warning(ex); + _connection->decProxyCount(); + _connection = 0; + __send(); } - catch(...) + else { - warning(); + try + { + ice_exception(exc); + } + catch(const Exception& ex) + { + warning(ex); + } + catch(const std::exception& ex) + { + warning(ex); + } + catch(...) + { + warning(); + } + + cleanup(); } - - cleanup(); } bool @@ -235,6 +272,12 @@ IceInternal::OutgoingAsync::__send() { while(true) { + if(!_connection) + { + _connection = _reference->getConnection(); + _connection->incProxyCount(); + } + try { _connection->sendAsyncRequest(__os, this); @@ -257,6 +300,9 @@ IceInternal::OutgoingAsync::__send() ex.ice_throw(); // The communicator is already destroyed, so we cannot retry. } } + + _connection->decProxyCount(); + _connection = 0; } } catch(const LocalException& ex) |