See Also

Tcp Class  | Tcp Members

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Language

Visual Basic

C#

C++

C++/CLI

Show All

See Also Languages PowerTCP SSL Sockets for .NET

NoDelay Property

Dart.PowerTCP.SslSockets Namespace > Tcp Class : NoDelay Property

Gets and sets a value the disables the use of Nagle's algorithm so that data is sent immediately.

[Visual Basic]
<CategoryAttribute("Socket Options")> <DefaultValueAttribute()> <DescriptionAttribute("Gets and Sets a value the disables the use of Nagle's algorithm so that data is sent immediately.")> Public Property NoDelay As Boolean
[C#]
[CategoryAttribute("Socket Options")] [DefaultValueAttribute()] [DescriptionAttribute("Gets and Sets a value the disables the use of Nagle's algorithm so that data is sent immediately.")] public bool NoDelay {get; set;}
[C++]
[CategoryAttribute("Socket Options")] [DefaultValueAttribute()] [DescriptionAttribute("Gets and Sets a value the disables the use of Nagle's algorithm so that data is sent immediately.")] public: __property bool get_NoDelay(); public: __property void set_NoDelay(    bool value );
[C++/CLI]
[CategoryAttribute("Socket Options")] [DefaultValueAttribute()] [DescriptionAttribute("Gets and Sets a value the disables the use of Nagle's algorithm so that data is sent immediately.")] public: property bool NoDelay {    bool get();    void set (bool value); }

Return Type

false if Nagle's algorithm is to be used; otherwise true. The default value is false.

Remarks

When small pieces of data (such as a byte) are send many times consecutively, inefficiency can result because a packet could be sent with 1 byte of useful data and 40 bytes of header information. Nagle's algorithm specifies that data such as this should be automatically concatenated and sent in a single packet. When true, Nagle's algorithm is defeated and data is immediately sent in a dedicated packet. When false, Nagle's algorithm is used so consecutive Send methods might send data as a single (more efficient) packet.

Setting this property to true could result in a speed optimization (because packets is sent immediately, without having to wait to see if Send is called again). Setting this property to false results in data being transmitted more efficiently.

Example

The following example demonstrates some of the lesser used Tcp component members.

[Visual Basic] 

' Disable UI events.
Tcp1.DoEvents = False

' Enable KeepAlive socket option
Tcp1.KeepAlive = True

' Disable use of Nagle's Algoritm
Tcp1.NoDelay = True

' Read urgent data as normal in-line data.
Tcp1.OutOfBandInline = True

' Allow addresses to be reused
Tcp1.ReuseAddress = True

' Connect
Tcp1.Connect("atropos", 7)

' Send data
Tcp1.Send("test")

' Receive response
Dim seg As Segment = Tcp1.Receive()

[C#] 


// Disable UI events.
tcp1.DoEvents = false;

// Enable KeepAlive socket option
tcp1.KeepAlive = true;

// Disable use of Nagle's Algoritm
tcp1.NoDelay = true;

// Read urgent data as normal in-line data.
tcp1.OutOfBandInline = true;

// Allow addresses to be reused
tcp1.ReuseAddress = true

// Connect
tcp1.Connect("atropos", 7);

// Send data
tcp1.Send("test");

// Receive response
Segment seg = tcp1.Receive();
                

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Tcp Class  | Tcp Members


Send comments on this topic.

Documentation version 1.1.2.0.

© 2008 Dart Communications.  All rights reserved.