On Windows systems, the variable to control the
FIN_WAIT_2 timeout interval can be modified in the Windows
Registry.
The Registry entry that controls this setting is
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters.
You need to specify the
TcpFinWait2Delay value for the above entry in the
registry. The default value is 240s.
Note
Administrator privileges are required to set this value.
In the Windows Registry, go to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\ParametersIf the
TcpFinWait2Delayvalue already appears in the details window, tune the value. The valid range is between 30s and 300s.If the value does not exist, right click and select Add a new DWORD value. Add
TcpFinWait2Delayand set its value.

