ChannelDispatcher.ServiceThrottle Propiedad

Definición

Obtiene o establece la limitación del servicio para el servicio asociado al distribuidor de canales.

public:
 property System::ServiceModel::Dispatcher::ServiceThrottle ^ ServiceThrottle { System::ServiceModel::Dispatcher::ServiceThrottle ^ get(); void set(System::ServiceModel::Dispatcher::ServiceThrottle ^ value); };
public System.ServiceModel.Dispatcher.ServiceThrottle ServiceThrottle { get; set; }
member this.ServiceThrottle : System.ServiceModel.Dispatcher.ServiceThrottle with get, set
Public Property ServiceThrottle As ServiceThrottle

Valor de propiedad

Un objeto ServiceThrottle.

Excepciones

El objeto de comunicación está en un Opening estado o Opened .

El objeto de comunicación está en un Closing estado o Closed .

El objeto de comunicación está en un Faulted estado .

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();

IChannelListener icl = serviceHost.ChannelDispatchers[0].Listener;
ChannelDispatcher dispatcher = new ChannelDispatcher(icl);
ServiceThrottle throttle = dispatcher.ServiceThrottle;
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 icl As IChannelListener = serviceHost.ChannelDispatchers(0).Listener
Dim dispatcher As New ChannelDispatcher(icl)
Dim throttle As ServiceThrottle = dispatcher.ServiceThrottle

Comentarios

Esto proporciona acceso a los controles usados para optimizar la disponibilidad y el rendimiento de un servicio.

Esta propiedad solo se puede establecer cuando la instancia de ChannelDispatcher está en estado Created , ya que es el único estado que es mutable y no se elimina.

Se aplica a