本文整理汇总了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);
}
示例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();
}