本文整理汇总了C#中System.ServiceModel.Dispatcher.MessageRpc.UnlockInvokeContinueGate方法的典型用法代码示例。如果您正苦于以下问题:C# MessageRpc.UnlockInvokeContinueGate方法的具体用法?C# MessageRpc.UnlockInvokeContinueGate怎么用?C# MessageRpc.UnlockInvokeContinueGate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.ServiceModel.Dispatcher.MessageRpc
的用法示例。
在下文中一共展示了MessageRpc.UnlockInvokeContinueGate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessMessage5
private void ProcessMessage5(ref MessageRpc rpc)
{
rpc.NextProcessor = _processMessage6;
bool success = false;
try
{
// If async call completes in sync, it tells us through the gate below
rpc.PrepareInvokeContinueGate();
SetActivityIdOnThread(ref rpc);
rpc.Operation.InvokeBegin(ref rpc);
success = true;
}
finally
{
try
{
if (rpc.IsPaused)
{
// Check if the callback produced the async result and set it back on the RPC on this stack
// and proceed only if the gate was signaled by the callback and completed synchronously
if (rpc.UnlockInvokeContinueGate(out rpc.AsyncResult))
{
rpc.UnPause();
}
}
}
catch (Exception e)
{
if (Fx.IsFatal(e))
{
throw;
}
if (success && !rpc.IsPaused)
{
throw;
}
_error.HandleError(e);
}
}
// Proceed if rpc is unpaused and invoke begin was successful.
if (!rpc.IsPaused)
{
this.ProcessMessage6(ref rpc);
}
}
示例2: ProcessMessage5
void ProcessMessage5(ref MessageRpc rpc)
{
rpc.NextProcessor = this.processMessage6;
try
{
bool success = false;
try
{
if (!rpc.Operation.IsSynchronous)
{
// If async call completes in [....], it tells us through the gate below
rpc.PrepareInvokeContinueGate();
}
if (this.transaction != null)
{
this.transaction.InitializeCallContext(ref rpc);
}
SetActivityIdOnThread(ref rpc);
rpc.Operation.InvokeBegin(ref rpc);
success = true;
}
finally
{
try
{
try
{
if (this.transaction != null)
{
this.transaction.ClearCallContext(ref rpc);
}
}
finally
{
if (!rpc.Operation.IsSynchronous && rpc.IsPaused)
{
// Check if the callback produced the async result and set it back on the RPC on this stack
// and proceed only if the gate was signaled by the callback and completed synchronously
if (rpc.UnlockInvokeContinueGate(out rpc.AsyncResult))
{
rpc.UnPause();
}
}
}
}
catch (Exception e)
{
if (Fx.IsFatal(e))
{
throw;
}
if (success && (rpc.Operation.IsSynchronous || !rpc.IsPaused))
{
throw;
}
this.error.HandleError(e);
}
}
}
catch
{
// This catch clause forces ClearCallContext to run prior to stackwalks exiting this frame.
throw;
}
// Proceed if rpc is unpaused and invoke begin was successful.
if (!rpc.IsPaused)
{
this.ProcessMessage6(ref rpc);
}
}
示例3: ProcessMessage5
private void ProcessMessage5(ref MessageRpc rpc)
{
rpc.NextProcessor = this.processMessage6;
try
{
bool flag = false;
try
{
if (!rpc.Operation.IsSynchronous)
{
rpc.PrepareInvokeContinueGate();
}
if (this.transaction != null)
{
this.transaction.InitializeCallContext(ref rpc);
}
rpc.Operation.InvokeBegin(ref rpc);
flag = true;
}
finally
{
try
{
try
{
if (this.transaction != null)
{
this.transaction.ClearCallContext(ref rpc);
}
}
finally
{
if ((!rpc.Operation.IsSynchronous && rpc.IsPaused) && rpc.UnlockInvokeContinueGate(out rpc.AsyncResult))
{
rpc.UnPause();
}
}
}
catch (Exception exception)
{
if (Fx.IsFatal(exception))
{
throw;
}
if (flag && (rpc.Operation.IsSynchronous || !rpc.IsPaused))
{
throw;
}
this.error.HandleError(exception);
}
}
}
catch
{
throw;
}
if (!rpc.IsPaused)
{
if (rpc.Operation.IsSynchronous)
{
this.ProcessMessage8(ref rpc);
}
else
{
this.ProcessMessage6(ref rpc);
}
}
}