ServiceThrottle.MaxConcurrentSessions Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets a value that specifies the maximum number of sessions a ServiceHost object can accept at one time.

Namespace:   System.ServiceModel.Dispatcher
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public int MaxConcurrentSessions { get; set; }

Property Value

Type: System.Int32

The maximum number of sessions a service host accepts. The default is 100 * number of processors in the computer.

The MaxConcurrentSessions property specifies the maximum number of channels a ServiceHost can accept. Each listener object can have one pending channel that does not count against the value of MaxConcurrentSessions until WCF accepts the channel and begins processing messages on it. This property is most useful in scenarios that make use of sessions.

System_CAPS_noteNote

A trace is written every time the value of this property is exceeded. The first trace is written as a warning.

For more information about sessions, see Using Sessions.

Typically, this property is set using the ServiceThrottlingBehavior.MaxConcurrentSessions property.

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.

.NET Framework
Available since 3.0
Return to top
Show: