Socket.NoDelay Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets a Boolean value that specifies whether the stream Socket is using the Nagle algorithm.

Namespace:   System.Net.Sockets
Assembly:  System (in System.dll)

member NoDelay : bool with get, set

Property Value

Type: System.Boolean

false if the Socket uses the Nagle algorithm; otherwise, true. The default is false.

Exception Condition

An error occurred when attempting to access the Socket. See the Remarks section for more information.


The Socket has been closed.

The Nagle algorithm is designed to reduce network traffic by causing the socket to buffer small packets and then combine and send them in one packet under certain circumstances. A TCP packet consists of 40 bytes of header plus the data being sent. When small packets of data are sent with TCP, the overhead resulting from the TCP header can become a significant part of the network traffic.On heavily loaded networks, the congestion resulting from this overhead can result in lost datagrams and retransmissions, as well as excessive propagation time caused by congestion. The Nagle algorithm inhibits the sending of new TCP segmentswhen new outgoing data arrives from the user if any previouslytransmitted data on the connection remains unacknowledged.

The majority of network applications should use the Nagle algorithm.

Setting this property on a User Datagram Protocol (UDP) socket will have no effect.

The following code example demonstrates the use of the NoDelay property.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 10
.NET Framework
Available since 2.0
Available since 2.0
Windows Phone Silverlight
Available since 7.1
Return to top