diff options
Diffstat (limited to 'csharp/src')
-rw-r--r-- | csharp/src/Ice/OutgoingAsync.cs | 22 | ||||
-rw-r--r-- | csharp/src/Ice/Proxy.cs | 8 |
2 files changed, 18 insertions, 12 deletions
diff --git a/csharp/src/Ice/OutgoingAsync.cs b/csharp/src/Ice/OutgoingAsync.cs index c7a30f1017b..ea08c6be130 100644 --- a/csharp/src/Ice/OutgoingAsync.cs +++ b/csharp/src/Ice/OutgoingAsync.cs @@ -18,7 +18,7 @@ namespace IceInternal { void init(OutgoingAsyncBase og); - bool handleSent(bool done, bool alreadySent); + bool handleSent(bool done, bool alreadySent, OutgoingAsyncBase og); bool handleException(Ice.Exception ex, OutgoingAsyncBase og); bool handleResponse(bool userThread, bool ok, OutgoingAsyncBase og); @@ -276,7 +276,7 @@ namespace IceInternal cacheMessageBuffers(); } - bool invoke = _completionCallback.handleSent(done, _alreadySent); + bool invoke = _completionCallback.handleSent(done, _alreadySent, this); if(!invoke && _doneInSent && observer_ != null) { observer_.detach(); @@ -1435,8 +1435,14 @@ namespace IceInternal } } - public bool handleSent(bool done, bool alreadySent) + public bool handleSent(bool done, bool alreadySent, OutgoingAsyncBase og) { + if(done && og.isSynchronous()) + { + Debug.Assert(progress_ == null); + handleInvokeSent(false, done, alreadySent, og); + return false; + } return done || progress_ != null && !alreadySent; // Invoke the sent callback only if not already invoked. } @@ -1479,14 +1485,14 @@ namespace IceInternal public virtual void handleInvokeSent(bool sentSynchronously, bool done, bool alreadySent, OutgoingAsyncBase og) { - if(done) - { - SetResult(default(T)); - } if(progress_ != null && !alreadySent) { progress_.Report(sentSynchronously); } + if(done) + { + SetResult(default(T)); + } } public void handleInvokeException(Ice.Exception ex, OutgoingAsyncBase og) @@ -1541,7 +1547,7 @@ namespace IceInternal outgoing_ = outgoing; } - public bool handleSent(bool done, bool alreadySent) + public bool handleSent(bool done, bool alreadySent, OutgoingAsyncBase og) { lock(this) { diff --git a/csharp/src/Ice/Proxy.cs b/csharp/src/Ice/Proxy.cs index 64b80c24718..8141471f56d 100644 --- a/csharp/src/Ice/Proxy.cs +++ b/csharp/src/Ice/Proxy.cs @@ -2717,14 +2717,14 @@ namespace Ice public override void handleInvokeSent(bool sentSynchronously, bool done, bool alreadySent, OutgoingAsyncBase og) { - if(done) - { - SetResult(new Object_Ice_invokeResult(true, null)); - } if(progress_ != null && !alreadySent) { progress_.Report(sentSynchronously); } + if(done) + { + SetResult(new Object_Ice_invokeResult(true, null)); + } } public override void handleInvokeResponse(bool ok, OutgoingAsyncBase og) |