diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/net.md | 13 |
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. |