When TCP sockets refuse to die
Then there is a discussion about forcefully killing sockets :)<p>* close(): socket will be lingering in background as usual<p>* shutdown(SHUT_RD): no network side effect, discards read buffer<p>* shutdown(SHUT_WR): equivalent to FIN SO_LINGER socket - if timeout non-zero blocks until write buffer flushed; if timeout is zero then immediately sends RST<p>* the trick with close() after TCP_REPAIR: (<a href="https://lwn.net/Articles/495304/" rel="nofollow">https://lwn.net/Articles/495304/</a>) immediately discard a socket with no network side effects.<p>* "ss --kill" command: forcefully close a socket from outside process, done with netlink SOCK_DESTROY command.