Поделиться через


NamedPipeTransportBindingElement.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

Элементы, описывающие привязки, поведение, контракты и другие сведения, необходимые для создания фабрики каналов.

Возвращаемое значение

Возвращает прослушиватель каналов заданного типа.

Исключения

Параметр context не может иметь значение null.

Передан недопустимый аргумент.

Примеры

В этом примере показано, как создать прослушиватель каналов заданного типа.

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

Комментарии

Этот метод можно использовать для получения прослушивателя каналов заданного типа с целью получения сообщений на основе конфигурации элемента привязки именованного канала.

Применяется к