Sdílet prostřednictvím


NamedPipeTransportBindingElement.BuildChannelListener<TChannel> Metoda

Definice

Vytvoří naslouchací proces kanálu zadaného 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 naslouchacího procesu kanálu, který chcete vytvořit.

Parametry

context
BindingContext

Členové, kteří popisují vazby, chování, kontrakty a další informace potřebné k vytvoření objektu pro vytváření kanálů.

Návraty

Vrátí naslouchací proces kanálu zadaného typu.

Výjimky

context nemůže být null.

Byl předán neplatný argument.

Příklady

Tento příklad ukazuje, jak vytvořit naslouchací proces kanálu zadaného typu:

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

Poznámky

Tuto metodu lze použít k získání naslouchacího procesu kanálu zadaného typu pro příjem zpráv na základě konfigurace pojmenovaného elementu vazby kanálu.

Platí pro