diff options
author | Matthew Newhook <matthew@zeroc.com> | 2014-09-03 11:01:11 -0230 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2014-09-03 11:01:11 -0230 |
commit | 3b0588532354adf7bf3b86e611a8ae4996bfe6ad (patch) | |
tree | 253961cb83af7bc3b1dfc7633a8f934789476cd1 /cpp/src/Ice/ConnectRequestHandler.cpp | |
parent | More work on ICE-2400: the send log thread now uses a separate communicator t... (diff) | |
download | ice-3b0588532354adf7bf3b86e611a8ae4996bfe6ad.tar.bz2 ice-3b0588532354adf7bf3b86e611a8ae4996bfe6ad.tar.xz ice-3b0588532354adf7bf3b86e611a8ae4996bfe6ad.zip |
- C#, Java: Removed Outgoing, fixed generated code to make synchronous
requests using AMI.
- Java: AsyncResult is now an interface.
- Added --arg to allTests.py.
- Fixed operations, adapterDeactivation and metrics test to work with
background IO.
- Added Collocated interrupt test.
- Added support for batch oneway requests using AMI.
- Added test in operations for batch oneway requests using AMI.
Diffstat (limited to 'cpp/src/Ice/ConnectRequestHandler.cpp')
-rw-r--r-- | cpp/src/Ice/ConnectRequestHandler.cpp | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/cpp/src/Ice/ConnectRequestHandler.cpp b/cpp/src/Ice/ConnectRequestHandler.cpp index a8e83697996..10f756be30c 100644 --- a/cpp/src/Ice/ConnectRequestHandler.cpp +++ b/cpp/src/Ice/ConnectRequestHandler.cpp @@ -287,25 +287,37 @@ ConnectRequestHandler::asyncRequestTimedOut(const OutgoingAsyncMessageCallbackPt } Ice::ConnectionIPtr -ConnectRequestHandler::getConnection(bool waitInit) +ConnectRequestHandler::getConnection() { Lock sync(*this); - if(waitInit) + if(_exception.get()) { - if(_exception.get()) - { - throw RetryException(*_exception.get()); - } - - // - // Wait for the connection establishment to complete or fail. - // - while(!_initialized && !_exception.get()) - { - wait(); - } + _exception->ice_throw(); + return 0; // Keep the compiler happy. + } + else + { + return _connection; + } +} + +Ice::ConnectionIPtr +ConnectRequestHandler::waitForConnection() +{ + Lock sync(*this); + if(_exception.get()) + { + throw RetryException(*_exception.get()); } - + + // + // Wait for the connection establishment to complete or fail. + // + while(!_initialized && !_exception.get()) + { + wait(); + } + if(_exception.get()) { _exception->ice_throw(); @@ -313,9 +325,8 @@ ConnectRequestHandler::getConnection(bool waitInit) } else { - assert(!waitInit || _initialized); return _connection; - } + } } void |