diff options
author | Benoit Foucher <benoit@zeroc.com> | 2014-10-10 12:03:07 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2014-10-10 12:03:07 +0200 |
commit | 570455a381e6620f8ddfcca448559d3fa545ba38 (patch) | |
tree | fe3fa45e6a643b473d9370babff6224b1a9d4dcb /cpp/test/Ice/retry/TestI.cpp | |
parent | Fixed ICE-5726: provide deprecated public StringConverterPlugin (diff) | |
download | ice-570455a381e6620f8ddfcca448559d3fa545ba38.tar.bz2 ice-570455a381e6620f8ddfcca448559d3fa545ba38.tar.xz ice-570455a381e6620f8ddfcca448559d3fa545ba38.zip |
Fixed invocation timeouts/interrupt issues, addded AsyncResult.cancel()
Diffstat (limited to 'cpp/test/Ice/retry/TestI.cpp')
-rw-r--r-- | cpp/test/Ice/retry/TestI.cpp | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/cpp/test/Ice/retry/TestI.cpp b/cpp/test/Ice/retry/TestI.cpp index b3545fa4c7a..9a0ed3fc81d 100644 --- a/cpp/test/Ice/retry/TestI.cpp +++ b/cpp/test/Ice/retry/TestI.cpp @@ -11,13 +11,6 @@ #include <TestI.h> #include <SystemFailure.h> -namespace -{ - -const int nRetry = 4; // See Ice.RetryIntervals configuration in Client.cpp/Collocated.cpp - -} - RetryI::RetryI() : _counter(0) { } @@ -39,9 +32,15 @@ RetryI::op(bool kill, const Ice::Current& current) } int -RetryI::opIdempotent(int counter, const Ice::Current& current) +RetryI::opIdempotent(int nRetry, const Ice::Current& current) { - if(counter + nRetry > _counter) + if(nRetry < 0) + { + _counter = 0; + return 0; + } + + if(nRetry > _counter) { ++_counter; if(current.con) @@ -52,19 +51,16 @@ RetryI::opIdempotent(int counter, const Ice::Current& current) { throw Ice::ConnectionLostException(__FILE__, __LINE__); } + return 0; } - return _counter; + int counter = _counter; + _counter = 0; + return counter; } void -RetryI::opNotIdempotent(int counter, const Ice::Current& current) +RetryI::opNotIdempotent(const Ice::Current& current) { - if(_counter != counter) - { - return; - } - - ++_counter; if(current.con) { current.con->close(true); |