From aa63e23863a49e71020433d242c80144fe2ad993 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Tue, 24 Jan 2023 18:41:07 +0100 Subject: [PATCH] doc: add documentation for socket.destroySoon() --- doc/api/net.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/api/net.md b/doc/api/net.md index f55c3d6d17b2bc..4b8a9f123c06eb 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -1051,6 +1051,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])`