共用方式為


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

適用於