From a64d7f4e31bf40265d566d84d6ec2efb3c06f5f7 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 5fb6246b8d8f92..f328320a5c8b2d 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -1049,6 +1049,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])`