Skip to content

Commit 4338ec3

Browse files
PupilTongPupilTong
authored and
PupilTong
committed
net: add ability to reset a tcp socket
make it possible to forcibly rest a tcp socket: * add a new method `Socket.prototype.resetAndDestroy` * add a new flag `resetAndClosing` to make `_destroy` calls the `reset` instead of close while destroying a Socket. * add new methods `TCPWrap::Reset` to be a wrap of `uv_tcp_close_reset` * change `HandleWrap::state_` from private to protected. This is essential for keeping the same behaviour between `TCPWrap::Reset` and `HandleWrap::Close` Fixes: nodejs#27428
1 parent f49e8b0 commit 4338ec3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/api/net.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ added: REPLACEME
10991099

11001100
Close the TCP connection by sending an RST packet and destroy the stream.
11011101
If this TCP socket is in connecting status, it will send an RST packet and destroy this TCP socket once it is connected.
1102-
Otherwise, it will call `socket.destroy` this socket with an `ERR_SOCKET_CLOSED` Error.
1102+
Otherwise, it will call `socket.destroy` with an `ERR_SOCKET_CLOSED` Error.
11031103
If this is not a TCP socket (for example, a pipe), calling this method will immediately throw an `ERR_INVALID_HANDLE_TYPE` Error.
11041104

11051105
### `socket.resume()`

0 commit comments

Comments
 (0)