Gets or sets the maximum number of messages actively processing across all dispatcher objects in a ServiceHost.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
The property specifies the maximum number of messages actively processing across all the dispatcher objects in a ServiceHost object. Each channel can have one pending message that does not count against the value of until Windows Communication Foundation (WCF) begins to process it.
A trace is written every time the value of this property is exceeded.
The following code example shows the typical use of the ServiceThrottle by referencing the ServiceThrottlingBehavior in an application configuration file. In this case, the values that are specified establish, at most, one message processing at one time from one connection to one InstanceContext. Real-world usage must be determined through experience.
<configuration> <appSettings> <!-- use appSetting to configure base address provided by host --> <add key="baseAddress" value="http://localhost:8080/ServiceMetadata" /> </appSettings> <system.serviceModel> <services> <service name="Microsoft.WCF.Documentation.SampleService" behaviorConfiguration="Throttled" > <host> <baseAddresses> <add baseAddress="http://localhost:8080/SampleService"/> </baseAddresses> </host> <endpoint address="" binding="wsHttpBinding" contract="Microsoft.WCF.Documentation.ISampleService" /> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service> </services> <behaviors> <serviceBehaviors> <behavior name="Throttled"> <serviceThrottling maxConcurrentCalls="1" maxConcurrentSessions="1" maxConcurrentInstances="1" /> <serviceMetadata httpGetEnabled="true" httpGetUrl="" /> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> </configuration>
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.