System.Net.ServicePointManager.DefaultConnectionLimit Property

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

Value: 2

Syntax

public static int DefaultConnectionLimit { get; set; }

Value

A int containing the maximum number of concurrent connections allowed by a System.Net.ServicePoint instance.

Exceptions

TypeReason
ArgumentOutOfRangeExceptionThe value specified for a set operation is less than or equal to zero.

Remarks

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

Changing the ServicePointManager.DefaultConnectionLimit property has no effect on existing System.Net.ServicePoint objects; it affects only System.Net.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 ServicePointManager.DefaultPersistentConnectionLimit.

Note:

Any changes to the ServicePointManager.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) ServicePointManager.DefaultConnectionLimit defaults to higher number of connections, which is 10.

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0