Skip to main content
Socket.prototype.resetAndDestroy - net - Node documentation
method Socket.prototype.resetAndDestroy

Usage in Deno

import { Socket } from "node:net";
Socket.prototype.resetAndDestroy(): this

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.

Return Type

this