ServicePoint.UseNagleAlgorithm 属性

定义

获取或设置一个 Boolean 值,该值确定在此 ServicePoint 对象所管理的连接上是否使用 Nagle 算法。

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

属性值

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

示例

下面的代码示例显示此属性的值。

Console::WriteLine( "UseNagleAlgorithm = {0} ", sp->UseNagleAlgorithm.ToString() );
Console::WriteLine( "Expect 100-continue = {0}", sp->Expect100Continue.ToString() );
Console.WriteLine("UseNagleAlgorithm = " + sp.UseNagleAlgorithm.ToString());
Console.WriteLine("Expect 100-continue = " + sp.Expect100Continue.ToString());

Console.WriteLine("UseNagleAlgorithm = " + sp.UseNagleAlgorithm.ToString())
Console.WriteLine("Expect 100-continue = " + sp.Expect100Continue.ToString())

注解

Nagle 算法用于缓冲小数据包,并将其作为单个数据包传输。 此过程(称为“nagling”)被广泛使用,因为它减少了传输的数据包数并降低了每个数据包的开销。

更改此属性的值不会影响现有连接。 只有更改后创建的新连接才会受到影响。

IETF RFC 896 中详细介绍了 Nagle 算法。

适用于