BindingContext.BuildInnerChannelListener<TChannel> 方法

定义

生成用于侦听指定类型的通道的内部通道侦听器。Builds an inner channel listener that listens for a specified type of channel.

public:
generic <typename TChannel>
 where TChannel : class, System::ServiceModel::Channels::IChannel System::ServiceModel::Channels::IChannelListener<TChannel> ^ BuildInnerChannelListener();
public System.ServiceModel.Channels.IChannelListener<TChannel> BuildInnerChannelListener<TChannel> () where TChannel : class, System.ServiceModel.Channels.IChannel;
member this.BuildInnerChannelListener : unit -> System.ServiceModel.Channels.IChannelListener<'Channel (requires 'Channel : null and 'Channel :> System.ServiceModel.Channels.IChannel)> (requires 'Channel : null and 'Channel :> System.ServiceModel.Channels.IChannel)
Public Function BuildInnerChannelListener(Of TChannel As {Class, IChannel}) () As IChannelListener(Of TChannel)

类型参数

TChannel

内部通道侦听器侦听的 IChannel 对象的类型。The type of IChannel object for which the inner channel listener listens.

返回

IChannelListener<TChannel>

类型为 IChannelListener<TChannel>IChannel,表示当前通道工厂的内部通道侦听器。The IChannelListener<TChannel> of type IChannel that represents the inner channel listener of the current channel factory.

示例

CustomBinding binding = new CustomBinding();
BindingParameterCollection bpCol = new BindingParameterCollection();
BindingContext context = new BindingContext(binding, bpCol);
context.BuildInnerChannelListener<IDuplexChannel>();
Dim binding As New CustomBinding()
Dim bpCol As New BindingParameterCollection()
Dim context As New BindingContext(binding, bpCol)
context.BuildInnerChannelListener(Of IDuplexChannel)()

适用于