ServicePointManager.DefaultPersistentConnectionLimit 字段

定义

在连接到 HTTP/1.1 或更高版本服务器的 ServicePoint 对象上允许存在的持久性连接的默认数目 (2)。 如果未以直接方式或通过配置设置 DefaultConnectionLimit 属性的值,则此字段为常量,用于初始化 DefaultConnectionLimit 属性。

public: int DefaultPersistentConnectionLimit = 2;
public const int DefaultPersistentConnectionLimit = 2;
val mutable DefaultPersistentConnectionLimit : int
Public Const DefaultPersistentConnectionLimit As Integer  = 2

字段值

Value = 2

示例

下面的代码示例使用此字段设置 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;
ServicePointManager.UseNagleAlgorithm = True
ServicePointManager.Expect100Continue = True
ServicePointManager.CheckCertificateRevocationList = True
ServicePointManager.DefaultConnectionLimit = _
    ServicePointManager.DefaultPersistentConnectionLimit

适用于