I am using .Net\'s socket class and I am using the following code:
socket.Shutdown(SocketShutdown.Both); socket.Disconnect(true);
This then
Turns out there is some registry entry which controls how long a disconnect takes. It has something to do with the WinSock2 api.