本文整理汇总了C#中Ice.getCurrent方法的典型用法代码示例。如果您正苦于以下问题:C# Ice.getCurrent方法的具体用法?C# Ice.getCurrent怎么用?C# Ice.getCurrent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ice
的用法示例。
在下文中一共展示了Ice.getCurrent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: dispatch
public override Ice.DispatchStatus dispatch(Ice.Request request)
{
Ice.Current current = request.getCurrent();
lastOperation_ = current.operation;
if(lastOperation_.Equals("addWithRetry"))
{
for(int i = 0; i < 10; ++i)
{
try
{
servant_.ice_dispatch(request);
test(false);
}
catch(Test.RetryException)
{
//
// Expected, retry
//
}
}
current.ctx["retry"] = "no";
}
lastStatus_ = servant_.ice_dispatch(request);
return lastStatus_;
}
示例2: dispatch
public override Ice.DispatchStatus dispatch(Ice.Request request)
{
Ice.Current current = request.getCurrent();
lastOperation_ = current.operation;
if(lastOperation_.Equals("amdAddWithRetry"))
{
for(int i = 0; i < 10; ++i)
{
Ice.DispatchInterceptorAsyncCallback cb = new DispatchInterceptorAsyncCallbackI();
lastStatus_ = servant_.ice_dispatch(request, cb);
test(lastStatus_ == Ice.DispatchStatus.DispatchAsync);
}
request.getCurrent().ctx["retry"] = "no";
}
lastStatus_ = servant_.ice_dispatch(request, this);
return lastStatus_;
}
示例3: dispatch
public override Task<Ice.OutputStream> dispatch(Ice.Request request)
{
Ice.Current current = request.getCurrent();
lastOperation_ = current.operation;
if(lastOperation_.Equals("addWithRetry") || lastOperation_.Equals("amdAddWithRetry"))
{
for(int i = 0; i < 10; ++i)
{
try
{
var t = servant_.ice_dispatch(request);
if(t != null && t.IsFaulted)
{
throw t.Exception.InnerException;
}
else
{
test(false);
}
}
catch(Test.RetryException)
{
//
// Expected, retry
//
}
}
current.ctx["retry"] = "no";
}
var task = servant_.ice_dispatch(request);
lastStatus_ = task != null;
return task;
}