Compartir vía


ChannelDispatcher.Listener Propiedad

Definición

Obtiene el agente de escucha asociado al distribuidor de canal.

public:
 virtual property System::ServiceModel::Channels::IChannelListener ^ Listener { System::ServiceModel::Channels::IChannelListener ^ get(); };
public override System.ServiceModel.Channels.IChannelListener Listener { get; }
member this.Listener : System.ServiceModel.Channels.IChannelListener
Public Overrides ReadOnly Property Listener As IChannelListener

Valor de propiedad

IChannelListener

IChannelListener asociado al distribuidor del canal.

Ejemplos

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;
Dim baseAddress As New Uri("http://localhost:8001/Simple")
Dim serviceHost As New ServiceHost(GetType(CalculatorService), baseAddress)

serviceHost.AddServiceEndpoint(GetType(ICalculator), New WSHttpBinding(), "CalculatorServiceObject")

serviceHost.Open()

Dim dispatcher As ChannelDispatcher = CType(serviceHost.ChannelDispatchers(0), ChannelDispatcher)
Dim listener As IChannelListener = dispatcher.Listener

Comentarios

Un ChannelDispatcher asocia un IChannelListener de un URI determinado a una instancia de un servicio.

Se aplica a