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


C# ITransport.Dispose方法代码示例

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


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

示例1: NewTransport

        protected virtual void NewTransport(ITransport t, IDictionary<string, string> capabilities)
        {
            Guid clientGuid;
            try
            {
                clientGuid = new Guid(capabilities[GTCapabilities.CLIENT_GUID]);
            }
            catch (Exception e)
            {
                log.Warn(String.Format("Exception occurred when decoding client's GUID: {0}",
                    capabilities[GTCapabilities.CLIENT_GUID]), e);
                t.Dispose();
                return;
            }

            // FIXME: Hmmm, how do we check the GTCapabilities.MARSHALLER_DESCRIPTORS?

            IConnexion c = GetConnexionForClientGuid(clientGuid);
            if (c == null)
            {
                //if (log.IsInfoEnabled)
                //{
                //    log.Info(String.Format("{0}: new client {1} via {2}", this, clientGuid, t));
                //}
                c = CreateNewConnexion(clientGuid);
            }
            else
            {
                //if (log.IsInfoEnabled)
                //{
                //    log.Info(String.Format("{0}: for client {1} via {2}", this, clientGuid, t));
                //}
            }
            t = Configuration.ConfigureTransport(t);
            c.AddTransport(t);
        }
开发者ID:briandealwis,项目名称:gt,代码行数:36,代码来源:Server.cs

示例2: TransportRejected

 /// <summary>
 /// The transport has failed the validation steps and must be disposed of. 
 /// Subclasses may override but must ensure the transport is disposed.
 /// </summary>
 /// <param name="transport">the candidate transport</param>
 /// <param name="capabilities">the capabilities of the remote</param>
 protected virtual void TransportRejected(ITransport transport, IDictionary<string, string> capabilities)
 {
     transport.Dispose();
 }
开发者ID:pichiliani,项目名称:CoMusic,代码行数:10,代码来源:Transports.cs


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