Export (0) Print
Expand All

ServicePointManager.DefaultConnectionLimit Property

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

[Visual Basic]
Public Shared Property DefaultConnectionLimit As Integer
[C#]
public static int DefaultConnectionLimit {get; set;}
[C++]
public: __property static int get_DefaultConnectionLimit();
public: __property static void set_DefaultConnectionLimit(int);
[JScript]
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.

Exceptions

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

Remarks

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.

Example

[Visual Basic, C#, C++] The following 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;

[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.

Requirements

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

Show:
© 2014 Microsoft