Skip to content

net: add ability to reset a tcp socket

Rodrigo Muino Tomonari requested to merge github/fork/PupilTong/socketreset into master

make it possible to forcibly rest a tcp socket:

  • add a new method Socket.prototype.resetAndDestroy

  • add a new private method Socket.prototype._reset

  • 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

  • add test cases for the new method

Fixes: https://github.com/nodejs/node/issues/27428

Merge request reports

Loading