NoDelay Property

TcpClient.NoDelay Property

Gets or sets a value that disables a delay when send or receive buffers are not full.

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

member NoDelay : bool with get, set

Property Value

Type: System.Boolean
true if the delay is disabled, otherwise false. The default value is false.

When NoDelay is false, a TcpClient does not send a packet over the network until it has collected a significant amount of outgoing data. Because of the amount of overhead in a TCP segment, sending small amounts of data is inefficient. However, situations do exist where you need to send very small amounts of data or expect immediate responses from each packet you send. Your decision should weigh the relative importance of network efficiency versus application requirements.

The following code example disables the delay. It then checks the value of NoDelay to verify that the property was successfully set.

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft