Skip to main content
Socket.prototype.setNoDelay - net - Node documentation
method Socket.prototype.setNoDelay

Usage in Deno

import { Socket } from "node:net";
Socket.prototype.setNoDelay(noDelay?: boolean): this

Enable/disable the use of Nagle's algorithm.

When a TCP connection is created, it will have Nagle's algorithm enabled.

Nagle's algorithm delays data before it is sent via the network. It attempts to optimize throughput at the expense of latency.

Passing true for noDelay or not passing an argument will disable Nagle's algorithm for the socket. Passing false for noDelay will enable Nagle's algorithm.

Parameters

optional
noDelay: boolean = true

Return Type

this

The socket itself.

Back to top