ChannelDispatcher.ServiceThrottle Propriété

Définition

Obtient ou définit la limitation de service pour le service associé au répartiteur de 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

Valeur de propriété

Objet ServiceThrottle.

Exceptions

L'objet de communication est dans un état Opening ou Opened.

L'objet de communication est dans l'état Closing ou Closed.

L'objet de communication est dans l'état Faulted.

Exemples

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

Remarques

Cela fournit l'accès aux contrôles utilisés pour optimiser la disponibilité et les performances d'un service.

Cette propriété peut uniquement être définie lorsque l'instance du ChannelDispatcher est à l'état Created, étant donné qu'il s'agit du seul état qui soit à la fois mutable et non disposé.

S’applique à