Udostępnij za pośrednictwem


NamedPipeTransportBindingElement.BuildChannelListener<TChannel> Metoda

Definicja

Tworzy odbiornik kanału określonego typu.

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)

Parametry typu

TChannel

Typ odbiornika kanału do utworzenia.

Parametry

context
BindingContext

Członkowie opisujący powiązania, zachowania, kontrakty i inne informacje wymagane do utworzenia fabryki kanałów.

Zwraca

Zwraca odbiornik kanału określonego typu.

Wyjątki

context nie może być null.

Przekazano nieprawidłowy argument.

Przykłady

W tym przykładzie pokazano, jak utworzyć odbiornik kanału o określonym typie:

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

Uwagi

Ta metoda może służyć do pobierania odbiornika kanału określonego typu do odbierania komunikatów na podstawie konfiguracji nazwanego elementu powiązania potoku.

Dotyczy