Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Reword socket.setNoDelay() #31541

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions doc/api/net.md
Original file line number Diff line number Diff line change
Expand Up @@ -879,9 +879,16 @@ added: v0.1.90
* `noDelay` {boolean} **Default:** `true`
* Returns: {net.Socket} The socket itself.

Disables the Nagle algorithm. By default TCP connections use the Nagle
algorithm, they buffer data before sending it off. Setting `true` for
`noDelay` will immediately fire off data each time `socket.write()` is called.
Enable/disable the Nagle algorithm.
rustyconover marked this conversation as resolved.
Show resolved Hide resolved

TCP connections when they are created have the Nagle algorithm enabled.
rustyconover marked this conversation as resolved.
Show resolved Hide resolved

The Nagle algorithm delays data before it is sent via the network. It attempts
rustyconover marked this conversation as resolved.
Show resolved Hide resolved
to optimize throughput at the expense of latency.

Setting `true` for `noDelay` or not passing an argument will disable the Nagle
rustyconover marked this conversation as resolved.
Show resolved Hide resolved
algorithm for the socket. Setting `false` for `noDelay` will enable the Nagle
algorithm.

### `socket.setTimeout(timeout[, callback])`
<!-- YAML
Expand Down