Edit

Share via


NamedPipeTransportBindingElement.BuildChannelListener<TChannel> Method

Definition

Creates a channel listener of the specified type.

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)

Type Parameters

TChannel

Type of channel listener to create.

Parameters

context
BindingContext

Members that describe bindings, behaviors, contracts and other information required to create the channel factory.

Returns

Returns a channel listener of the specified type.

Exceptions

context cannot be null.

An invalid argument was passed.

Examples

This example shows how to creates a channel listener of the specified type:

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

Remarks

This method can be used to get a channel listener of the specified type for receiving messages based on the configuration of the named pipe binding element.

Applies to