Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Previous Versions
.NET Framework 2.0
System.Net
 DefaultConnectionLimit Property

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
.NET Framework Class Library
ServicePointManager.DefaultConnectionLimit Property

Gets or sets the maximum number of concurrent connections allowed by a ServicePoint object.

Namespace: System.Net
Assembly: System (in system.dll)

Visual Basic (Declaration)
Public Shared Property DefaultConnectionLimit As Integer
Visual Basic (Usage)
Dim value As Integer

value = ServicePointManager.DefaultConnectionLimit

ServicePointManager.DefaultConnectionLimit = value
C#
public static int DefaultConnectionLimit { get; set; }
C++
public:
static property int DefaultConnectionLimit {
    int get ();
    void set (int value);
}
J#
/** @property */
public static int get_DefaultConnectionLimit ()

/** @property */
public static void set_DefaultConnectionLimit (int value)
JScript
public static function get DefaultConnectionLimit () : int

public static function set DefaultConnectionLimit (value : int)

Property Value

The maximum number of concurrent connections allowed by a ServicePoint object. The default value is 2.
Exception typeCondition

ArgumentOutOfRangeException

DefaultConnectionLimit is less than or equal to 0.

The DefaultConnectionLimit property sets the default maximum number of concurrent connections that the ServicePointManager object assigns to the ConnectionLimit property when creating ServicePoint objects.

Changing the DefaultConnectionLimit property has no effect on existing ServicePoint objects; it affects only ServicePoint objects that are initialized after the change. If the value of this property has not been set either directly or through configuration, the value defaults to the constant DefaultPersistentConnectionLimit.

NoteNote

Any changes to the DefaultConnectionLimit property affect both HTTP 1.0 and HTTP 1.1 connections. It is not possible to separately alter the connection limit for HTTP 1.0 and HTTP 1.1 protocols. When used in the server environment (ASP.NET) DefaultConnectionLimit defaults to higher number of connections, which is 10.

The following code example sets this property.

Visual Basic
ServicePointManager.UseNagleAlgorithm = True
ServicePointManager.Expect100Continue = True
ServicePointManager.CheckCertificateRevocationList = True
ServicePointManager.DefaultConnectionLimit = _
    ServicePointManager.DefaultPersistentConnectionLimit
C#
ServicePointManager.UseNagleAlgorithm = true;
ServicePointManager.Expect100Continue = true;
ServicePointManager.CheckCertificateRevocationList = true;
ServicePointManager.DefaultConnectionLimit = ServicePointManager.DefaultPersistentConnectionLimit;
C++
ServicePointManager::UseNagleAlgorithm = true;
ServicePointManager::Expect100Continue = true;
ServicePointManager::CheckCertificateRevocationList = true;
ServicePointManager::DefaultConnectionLimit = ServicePointManager::DefaultPersistentConnectionLimit;

J#
ServicePointManager.set_UseNagleAlgorithm(true);
ServicePointManager.set_Expect100Continue(true);
ServicePointManager.set_CheckCertificateRevocationList(true);
ServicePointManager.set_DefaultConnectionLimit(
    ServicePointManager.DefaultPersistentConnectionLimit);

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker