DefaultConnectionLimit Property

ServicePointManager.DefaultConnectionLimit Property

The maximum number of concurrent connections allowed by a ServicePoint instance.

[Visual Basic]
Public Shared Property DefaultConnectionLimit As Integer
public static int DefaultConnectionLimit {get; set;}
public: __property static int get_DefaultConnectionLimit();
public: __property static void set_DefaultConnectionLimit(int);
public static function get DefaultConnectionLimit() : int;
public static function set DefaultConnectionLimit(int);

Property Value

The maximum number of concurrent connections allowed by a ServicePoint instance.


Exception Type Condition
ArgumentOutOfRangeException DefaultConnectionLimit is less than or equal to 0.


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

Changing the DefaultConnectionLimit property has no effect on existing ServicePoint instances; it affects only ServicePoint instances that are initialized after the change.


[Visual Basic, C#, C++] The following example sets this property.

[Visual Basic] 
ServicePointManager.UseNagleAlgorithm = True
ServicePointManager.Expect100Continue = True
ServicePointManager.CheckCertificateRevocationList = True
ServicePointManager.DefaultConnectionLimit = _

ServicePointManager.UseNagleAlgorithm = true;
ServicePointManager.Expect100Continue = true;
ServicePointManager.CheckCertificateRevocationList = true;
ServicePointManager.DefaultConnectionLimit = ServicePointManager.DefaultPersistentConnectionLimit;

ServicePointManager::UseNagleAlgorithm = true;
ServicePointManager::Expect100Continue = true;
ServicePointManager::CheckCertificateRevocationList = true;
ServicePointManager::DefaultConnectionLimit = ServicePointManager::DefaultPersistentConnectionLimit;

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

.NET Framework Security: 

See Also

ServicePointManager Class | ServicePointManager Members | System.Net Namespace

© 2016 Microsoft