diff options
author | Benoit Foucher <benoit@zeroc.com> | 2008-10-28 15:37:54 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2008-10-28 15:37:54 +0100 |
commit | 4cf71ddedfbcb89f1f8892c87bc6df68f1086c0e (patch) | |
tree | 0eb73fac0730f0a7bb3046e9c3b2cba8a4185654 /cpp/src/Ice/ProxyFactory.cpp | |
parent | Locator improvements to improve scalability when receiving many requests (diff) | |
download | ice-4cf71ddedfbcb89f1f8892c87bc6df68f1086c0e.tar.bz2 ice-4cf71ddedfbcb89f1f8892c87bc6df68f1086c0e.tar.xz ice-4cf71ddedfbcb89f1f8892c87bc6df68f1086c0e.zip |
Fixed bug 3513 - AMI retry bug
Diffstat (limited to 'cpp/src/Ice/ProxyFactory.cpp')
-rw-r--r-- | cpp/src/Ice/ProxyFactory.cpp | 59 |
1 files changed, 9 insertions, 50 deletions
diff --git a/cpp/src/Ice/ProxyFactory.cpp b/cpp/src/Ice/ProxyFactory.cpp index 2fc5316eb6d..eeb554d3e4a 100644 --- a/cpp/src/Ice/ProxyFactory.cpp +++ b/cpp/src/Ice/ProxyFactory.cpp @@ -25,32 +25,8 @@ using namespace std; using namespace Ice; using namespace IceInternal; -namespace -{ - -class RetryTask : public IceUtil::TimerTask -{ -public: - - RetryTask(const OutgoingAsyncPtr& out) : _out(out) - { - } - - virtual void - runTimerTask() - { - _out->__send(); - } - -private: - - const OutgoingAsyncPtr _out; -}; - -} - IceUtil::Shared* IceInternal::upCast(ProxyFactory* p) { return p; } - + ObjectPrx IceInternal::ProxyFactory::stringToProxy(const string& str) const { @@ -243,34 +219,17 @@ IceInternal::ProxyFactory::checkRetryAfterException(const LocalException& ex, } out << " because of exception\n" << ex; } - - if(interval > 0) + + if(out) { - if(out) - { - try - { - _instance->timer()->schedule(new RetryTask(out), IceUtil::Time::milliSeconds(interval)); - } - catch(const IceUtil::IllegalArgumentException&) // Expected if the communicator destroyed the timer. - { - throw CommunicatorDestroyedException(__FILE__, __LINE__); - } - } - else - { - // - // Sleep before retrying. - // - IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(interval)); - } + out->__retry(interval); } - else + else if(interval > 0) { - if(out) - { - out->__send(); - } + // + // Sleep before retrying. + // + IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(interval)); } } |