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.

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

ServiceThrottle

Um objeto ServiceThrottle.

Exceções

O objeto de comunicação está em um estado Opening ou Opened.

O objeto de comunicação está em um estado Closing ou Closed.

O objeto de comunicação está em um estado Faulted.

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.

Essa propriedade só pode ser definida quando a instância do ChannelDispatcher está no Created estado, pois esse é o único estado que é mutável e não descartado.

Aplica-se a