当前位置: 首页>>代码示例>>C#>>正文


C# IChannel.Abort方法代码示例

本文整理汇总了C#中IChannel.Abort方法的典型用法代码示例。如果您正苦于以下问题:C# IChannel.Abort方法的具体用法?C# IChannel.Abort怎么用?C# IChannel.Abort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IChannel的用法示例。


在下文中一共展示了IChannel.Abort方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Abort

 private static void Abort(IChannel channel, ChannelFactory channelFactory)
 {
     if (channel != null)
         channel.Abort();
     if (channelFactory != null)
         channelFactory.Abort();
 }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:7,代码来源:client.cs

示例2: Abort

 static void Abort(IChannel channel, ChannelFactory cf)
 {
     if (channel != null)
         channel.Abort();
     if (cf != null)
         cf.Abort();
 }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:7,代码来源:client.cs

示例3: CloseChannel

 private void CloseChannel(IChannel channel, TimeSpan timeout)
 {
     try
     {
         if ((channel.State != CommunicationState.Closing) && (channel.State != CommunicationState.Closed))
         {
             CloseChannelState state = new CloseChannelState(this, channel);
             if (channel is ISessionChannel<IDuplexSession>)
             {
                 IDuplexSession session = ((ISessionChannel<IDuplexSession>) channel).Session;
                 IAsyncResult result = session.BeginCloseOutputSession(timeout, Fx.ThunkCallback(new AsyncCallback(ListenerHandler.CloseOutputSessionCallback)), state);
                 if (result.CompletedSynchronously)
                 {
                     session.EndCloseOutputSession(result);
                 }
             }
             else
             {
                 IAsyncResult result2 = channel.BeginClose(timeout, Fx.ThunkCallback(new AsyncCallback(ListenerHandler.CloseChannelCallback)), state);
                 if (result2.CompletedSynchronously)
                 {
                     channel.EndClose(result2);
                 }
             }
         }
     }
     catch (Exception exception)
     {
         if (Fx.IsFatal(exception))
         {
             throw;
         }
         this.HandleError(exception);
         if (channel is ISessionChannel<IDuplexSession>)
         {
             channel.Abort();
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:39,代码来源:ListenerHandler.cs


注:本文中的IChannel.Abort方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。