ServicePointManager.UseNagleAlgorithm 属性

定义

确定由此 ServicePointManager 对象管理的服务点是否使用 Nagle 算法。

public:
 static property bool UseNagleAlgorithm { bool get(); void set(bool value); };
public static bool UseNagleAlgorithm { get; set; }
static member UseNagleAlgorithm : bool with get, set
Public Shared Property UseNagleAlgorithm As Boolean

属性值

如果使用 Nagle 算法,则为 true;否则为 false。 默认值为 true

示例

下面的代码示例设置此属性。

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

注解

Nagle 算法用于通过缓冲小数据包并将其作为单个数据包传输来减少网络流量。 此过程也称为“无所事事”:它被广泛使用,因为它减少了传输的数据包数并降低了每个数据包的开销。

更改此属性的值不会影响现有 ServicePoint 对象。 只有更改后创建的新服务点才会受到影响。

IETF RFC 896 中全面介绍了 Nagle 算法。

适用于

另请参阅