joyent/libuv — pull request #498 by indutny (2012-07-21 08:40:02+00:00)
Title: tcp: uv_tcp_reset_timed(...)

Usually close() syscall will send a FIN packet to the other side and
wait for it's acceptance. While it's waiting, socket will persist in
system since FIN packet may get lost in the way to other side and will
need to be sent again. But when dealing with TCP clients that are
unable to do so (i.e. mobile, or clients under firewall), hanging
TIME_WAIT or FIN_WAIT2 connections will be left.

Introduced function (when followed by close() call) will send RST
packet instead of FIN, and will immediately destroy socket and remove
it from system's list.

/cc @bnoordhuis