本文整理汇总了C#中TransportContext.GetChannelBinding方法的典型用法代码示例。如果您正苦于以下问题:C# TransportContext.GetChannelBinding方法的具体用法?C# TransportContext.GetChannelBinding怎么用?C# TransportContext.GetChannelBinding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransportContext
的用法示例。
在下文中一共展示了TransportContext.GetChannelBinding方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckTransportContext
public void CheckTransportContext(TransportContext context)
{
var cbt1 = context.GetChannelBinding(ChannelBindingKind.Endpoint);
var cbt2 = context.GetChannelBinding(ChannelBindingKind.Unique);
var cbt3 = context.GetChannelBinding(ChannelBindingKind.Unknown);
CheckChannelBinding(cbt1);
CheckChannelBinding(cbt2);
CheckChannelBinding(cbt3);
Assert.True(cbt1 != null, "ChannelBindingKind.Endpoint token data should be returned from SCHANNEL.");
Assert.True(cbt2 != null, "ChannelBindingKind.Unique token data should be returned from SCHANNEL.");
Assert.True(cbt3 == null, "ChannelBindingKind.Unknown token data should not be returned from SCHANNEL since it does not map to a defined context attribute.");
}
示例2: SerializeToStreamAsync
protected override Task SerializeToStreamAsync(Stream stream, TransportContext context)
{
ChannelBinding = context.GetChannelBinding(ChannelBindingKind.Endpoint);
return base.SerializeToStreamAsync(stream, context);
}
示例3: SerializeToStreamAsync
protected override Task SerializeToStreamAsync(Stream stream, TransportContext context)
{
ChannelBinding = context.GetChannelBinding(ChannelBindingKind.Endpoint);
return stream.WriteAsync(_content, 0, _content.Length);
}