From 919e581732093359a3402b86160e79f1e8b7b007 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Sat, 28 Jan 2023 07:00:45 +0100 Subject: [PATCH] doc: add documentation for socket.destroySoon() PR-URL: https://github.com/nodejs/node/pull/46337 Reviewed-By: Paolo Insogna Reviewed-By: Matteo Collina --- doc/api/net.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/api/net.md b/doc/api/net.md index 1e9288d9c734a3..1a807ccac3de1d 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -1024,6 +1024,16 @@ See [`writable.destroy()`][] for further details. See [`writable.destroyed`][] for further details. +### `socket.destroySoon()` + + + +Destroys the socket after all data is written. If the `'finish'` event was +already emitted the socket is destroyed immediately. If the socket is still +writable it implicitly calls `socket.end()`. + ### `socket.end([data[, encoding]][, callback])`