diff options
author | Benoit Foucher <benoit@zeroc.com> | 2007-12-12 18:54:19 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2007-12-12 18:54:19 +0100 |
commit | 3dff2b82d498d2e29dc4c42c4053557e16a373d4 (patch) | |
tree | 4242da8678ce8f36e34b9d821212cf78519af415 /java/src/IceInternal/Outgoing.java | |
parent | Merge branch 'master' of ssh://cvs.zeroc.com/home/git/ice (diff) | |
download | ice-3dff2b82d498d2e29dc4c42c4053557e16a373d4.tar.bz2 ice-3dff2b82d498d2e29dc4c42c4053557e16a373d4.tar.xz ice-3dff2b82d498d2e29dc4c42c4053557e16a373d4.zip |
Fixed bug 2592
Diffstat (limited to 'java/src/IceInternal/Outgoing.java')
-rw-r--r-- | java/src/IceInternal/Outgoing.java | 54 |
1 files changed, 18 insertions, 36 deletions
diff --git a/java/src/IceInternal/Outgoing.java b/java/src/IceInternal/Outgoing.java index 2830f59e4b5..4f578b37adb 100644 --- a/java/src/IceInternal/Outgoing.java +++ b/java/src/IceInternal/Outgoing.java @@ -64,6 +64,7 @@ public final class Outgoing implements OutgoingMessageCallback _state = StateInProgress; Ice.ConnectionI connection = _handler.sendRequest(this); + assert(connection != null); boolean timedOut = false; @@ -186,52 +187,33 @@ public final class Outgoing implements OutgoingMessageCallback case Reference.ModeOneway: case Reference.ModeDatagram: { - try + _state = StateInProgress; + if(_handler.sendRequest(this) != null) { - _state = StateInProgress; - if(_handler.sendRequest(this) != null) + // + // If the handler returns the connection, we must wait for the sent callback. + // + synchronized(this) { - // - // If the handler returns the connection, we must wait for the sent callback. - // - synchronized(this) + while(_state != StateFailed && !_sent) { - while(_state != StateFailed && !_sent) + try { - try - { - wait(); - } - catch(java.lang.InterruptedException ex) - { - } + wait(); } - - if(_exception != null) + catch(java.lang.InterruptedException ex) { - assert(!_sent); - throw _exception; } } - } - return true; - } - catch(Ice.LocalException ex) // Java specfic work-around (see ConnectionI.sendRequest()) - { - if(!_sent) // The send might have failed but the request might still be sent... - { - throw ex; - } - else - { - // - // We wrap the exception into a LocalExceptionWrapper to indicate that - // the request cannot be resent without potentially violating the - // "at-most-once" principle. - // - throw new IceInternal.LocalExceptionWrapper(ex, false); + + if(_exception != null) + { + assert(!_sent); + throw _exception; + } } } + return true; } case Reference.ModeBatchOneway: |