Share via


TcpTransportBindingElement.BuildChannelListener<TChannel> メソッド

定義

指定した種類のチャネル リスナーを作成します。

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

型パラメーター

TChannel

チャネル リスナーの種類。

パラメーター

context
BindingContext

バインド、動作、コントラクト、およびチャネル ファクトリの作成に必要なその他の情報を記述する BindingContext メンバー。

戻り値

指定した種類のチャネル リスナーを返します。

例外

context として null を使用することはできません。

無効な引数が渡されました。

次の例では、指定した種類のチャネル リスナーを返す方法を示します。

IChannelListener<IOutputChannel> listener =
    binding.BuildChannelListener<IOutputChannel>(bContext);

注釈

このメソッドを使用すると、TCP バインディング要素の構成に基づいてメッセージを受信するためのチャネル リスナーを作成できます。

適用対象