summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/OutgoingAsync.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/OutgoingAsync.cpp')
-rw-r--r--cpp/src/Ice/OutgoingAsync.cpp66
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)