共用方式為


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

屬性值

true 表示使用 Nagle 演算法;否則為 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 演算法是用來緩衝小型數據封包,並將其傳輸為單一封包。 此程式稱為「流覽」,廣泛使用,因為它可減少傳輸的封包數目,並降低每個封包的額外負荷。

變更此屬性的值不會影響現有的連線。 只有變更之後建立的新連線才會受到影響。

Nagle 演算法會在 IETF RFC 896 中完整描述。

適用於