ChannelDispatcher.ServiceThrottle Propriedade

Definição

Obtém ou define a limitação de serviço para o serviço associado com o dispatcher do canal.Gets or sets the service throttle for the service associated with the channel dispatcher.

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 da propriedade

Exceções

O objeto de comunicação está em um estado Opening ou Opened.The communication object is in an Opening or Opened state.

O objeto de comunicação está em um estado Closing ou Closed.The communication object is in a Closing or Closed state.

O objeto de comunicação está em um estado Faulted.The communication object is in a Faulted state.

Exemplos

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

Comentários

Isso fornece acesso aos controles usados para otimizar a disponibilidade e o desempenho de um serviço.This provides access to the controls used to optimize the availability and performance of a service.

Essa propriedade só pode ser definida quando a instância do ChannelDispatcher está Created no estado, pois esse é o único Estado que é mutável e não Descartado.This property can only be set when the instance of the ChannelDispatcher is in the Created state, as this is the only state that is both mutable and not disposed.

Aplica-se a