ChannelDispatcher.Listener Property

Definition

Gets the listener associated with the channel dispatcher.

C#
public override System.ServiceModel.Channels.IChannelListener Listener { get; }

Property Value

The IChannelListener associated with the channel dispatcher.

Examples

C#
Uri baseAddress = new Uri("http://localhost:8001/Simple");
ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress);

serviceHost.AddServiceEndpoint(
    typeof(ICalculator),
    new WSHttpBinding(),
    "CalculatorServiceObject");

serviceHost.Open();

ChannelDispatcher dispatcher = (ChannelDispatcher)serviceHost.ChannelDispatchers[0];
IChannelListener listener = dispatcher.Listener;

Remarks

A ChannelDispatcher associates an IChannelListener at a particular URI with an instance of a service.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1