The basic information is described in detail below, including when it is really necessary to force an interruption of the connection, described here ( fooobar.com/questions/16439 / ... ).
C # Method:
socket.LingerState = new LingerOption(true, 0); socket.Close();
That is, use SO_LINGER with TIME_WAIT = 0
zahical
source share