Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/node/net.ts>Socket#setNoDelay

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
method Socket.prototype.setNoDelay
import { Socket } from "https://deno.land/std@0.138.0/node/net.ts";

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

Returns

this

The socket itself.