ChannelDispatcher.ServiceThrottle Właściwość

Definicja

Pobiera lub ustawia ograniczenie usługi dla usługi skojarzonej z dyspozytorem kanału.

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

Wartość właściwości

ServiceThrottle

Obiekt ServiceThrottle.

Wyjątki

Obiekt komunikacji jest w Opening stanie lub Opened .

Obiekt komunikacji jest w Closing stanie lub Closed .

Obiekt komunikacji jest w Faulted stanie.

Przykłady

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

Uwagi

Zapewnia to dostęp do kontrolek używanych do optymalizacji dostępności i wydajności usługi.

Tę właściwość można ustawić tylko wtedy, gdy wystąpienie obiektu ChannelDispatcher jest w Created stanie, ponieważ jest to jedyny stan, który jest zarówno modyfikowalny, jak i nie usuwany.

Dotyczy