Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorpupilTong <pupiltong@outlook.com>2022-05-15 16:54:06 +0300
committerBryan English <bryan@bryanenglish.com>2022-05-30 19:33:54 +0300
commit8f5b4570e50f3b8333f70065dac7b09148c02dc4 (patch)
tree7439870f198cecd2ebca5f411f7cd6f3037cd8c5 /doc
parent41b69e3cf469ea683592e20278f0b04c413ff34f (diff)
net: add ability to reset a tcp socket
Fixes: https://github.com/nodejs/node/issues/27428 PR-URL: https://github.com/nodejs/node/pull/43112 Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/net.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/api/net.md b/doc/api/net.md
index 39d7cbdac53..b3eecd2e98c 100644
--- a/doc/api/net.md
+++ b/doc/api/net.md
@@ -1087,6 +1087,19 @@ added: v0.5.10
The numeric representation of the remote port. For example, `80` or `21`.
+### `socket.resetAndDestroy()`
+
+<!-- YAML
+added: REPLACEME
+-->
+
+* Returns: {net.Socket}
+
+Close the TCP connection by sending an RST packet and destroy the stream.
+If this TCP socket is in connecting status, it will send an RST packet and destroy this TCP socket once it is connected.
+Otherwise, it will call `socket.destroy` with an `ERR_SOCKET_CLOSED` Error.
+If this is not a TCP socket (for example, a pipe), calling this method will immediately throw an `ERR_INVALID_HANDLE_TYPE` Error.
+
### `socket.resume()`
* Returns: {net.Socket} The socket itself.