ChannelDispatcher Constructor (IChannelListener, String)

 

Initializes a new instance of the ChannelDispatcher class.

Namespace:   System.ServiceModel.Dispatcher
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public ChannelDispatcher(
	IChannelListener listener,
	string bindingName
)

Parameters

listener
Type: System.ServiceModel.Channels.IChannelListener

The IChannelListener for the channel dispatcher.

bindingName
Type: System.String

The name of the binding used to configure the service.

Exception Condition
ArgumentNullException

listener is null.

Initializes a new instance of the ChannelDispatcher class from the provided listener and binding, with system-provided default timeouts.

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

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

serviceHost.Open();

IChannelListener icl = serviceHost.ChannelDispatchers[0].Listener;
ChannelDispatcher dispatcher = new ChannelDispatcher(icl, "MyTestBinding");

.NET Framework
Available since 3.0
Return to top
Show: