Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f46df0b

Browse filesBrowse files
Trotttargos
authored andcommitted
doc: update socket.bufferSize text
Edit text for clarity and readability. PR-URL: #30723 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 7aa1df7 commit f46df0b
Copy full SHA for f46df0b

File tree

Expand file treeCollapse file tree

1 file changed

+6
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-8
lines changed
Open diff view settings
Collapse file

‎doc/api/net.md‎

Copy file name to clipboardExpand all lines: doc/api/net.md
+6-8Lines changed: 6 additions & 8 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -548,19 +548,17 @@ added: v0.3.8
548548

549549
* {integer}
550550

551+
This property shows the number of characters buffered for writing. The buffer
552+
may contain strings whose length after encoding is not yet known. So this number
553+
is only an approximation of the number of bytes in the buffer.
554+
551555
`net.Socket` has the property that `socket.write()` always works. This is to
552556
help users get up and running quickly. The computer cannot always keep up
553557
with the amount of data that is written to a socket. The network connection
554558
simply might be too slow. Node.js will internally queue up the data written to a
555-
socket and send it out over the wire when it is possible. (Internally it is
556-
polling on the socket's file descriptor for being writable).
557-
558-
The consequence of this internal buffering is that memory may grow. This
559-
property shows the number of characters currently buffered to be written.
560-
(Number of characters is approximately equal to the number of bytes to be
561-
written, but the buffer may contain strings, and the strings are lazily
562-
encoded, so the exact number of bytes is not known.)
559+
socket and send it out over the wire when it is possible.
563560

561+
The consequence of this internal buffering is that memory may grow.
564562
Users who experience large or growing `bufferSize` should attempt to
565563
"throttle" the data flows in their program with
566564
[`socket.pause()`][] and [`socket.resume()`][].

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.