summaryrefslogtreecommitdiff
path: root/csharp/test/Ice/interceptor/InterceptorI.cs
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/test/Ice/interceptor/InterceptorI.cs')
-rw-r--r--csharp/test/Ice/interceptor/InterceptorI.cs33
1 files changed, 20 insertions, 13 deletions
diff --git a/csharp/test/Ice/interceptor/InterceptorI.cs b/csharp/test/Ice/interceptor/InterceptorI.cs
index 92abf9796c8..f212dd4d9a6 100644
--- a/csharp/test/Ice/interceptor/InterceptorI.cs
+++ b/csharp/test/Ice/interceptor/InterceptorI.cs
@@ -8,8 +8,7 @@
// **********************************************************************
using System;
-using System.Collections;
-using System.Diagnostics;
+using System.Threading.Tasks;
class InterceptorI : Ice.DispatchInterceptor
{
@@ -27,20 +26,27 @@ class InterceptorI : Ice.DispatchInterceptor
}
}
- public override Ice.DispatchStatus
+ public override Task<Ice.OutputStream>
dispatch(Ice.Request request)
{
Ice.Current current = request.getCurrent();
lastOperation_ = current.operation;
- if(lastOperation_.Equals("addWithRetry"))
+ if(lastOperation_.Equals("addWithRetry") || lastOperation_.Equals("amdAddWithRetry"))
{
for(int i = 0; i < 10; ++i)
{
try
{
- servant_.ice_dispatch(request);
- test(false);
+ var t = servant_.ice_dispatch(request);
+ if(t != null && t.IsFaulted)
+ {
+ throw t.Exception.InnerException;
+ }
+ else
+ {
+ test(false);
+ }
}
catch(Test.RetryException)
{
@@ -49,15 +55,16 @@ class InterceptorI : Ice.DispatchInterceptor
//
}
}
-
+
current.ctx["retry"] = "no";
}
-
- lastStatus_ = servant_.ice_dispatch(request);
- return lastStatus_;
+
+ var task = servant_.ice_dispatch(request);
+ lastStatus_ = task != null;
+ return task;
}
- internal Ice.DispatchStatus
+ internal bool
getLastStatus()
{
return lastStatus_;
@@ -73,10 +80,10 @@ class InterceptorI : Ice.DispatchInterceptor
clear()
{
lastOperation_ = null;
- lastStatus_ = Ice.DispatchStatus.DispatchAsync;
+ lastStatus_ = false;
}
protected readonly Ice.Object servant_;
protected string lastOperation_;
- protected Ice.DispatchStatus lastStatus_ = Ice.DispatchStatus.DispatchAsync;
+ protected bool lastStatus_ = false;
}