How to kill windows zombie tcp connections?

You can use Nirsoft's Currports to monitor and kill connections.

You can automate killing of a connection pattern using AutoHotKey.


CLOSE_WAIT means that the connection was closed on the other end.

Evidently, beyondtv doesn't detect this condition and continues to send data to the application on the other end. The other end can't send anything back over this connection, since it has closed its end of the connection.

The solution is to set the TcpTimedWaitDelay entry in

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\tcpip\Parameters

This entry determines the time that must elapse before TCP can release a closed connection and reuse its resources. This interval between closure and release is known as the TIME_WAIT state or 2MSL state. During this time, the connection can be reopened at much less cost to the client and server than establishing a new connection.

By default on my machine, this contains the value of -1, which I take to mean that closed connections are never released, which is exactly the behavior that you're observing.

I suggest that you set the value of this entry in the allowed range of 30–300 seconds. I suppose that 300 seconds = 5 minutes is entirely sufficient for your case, where it takes 40 minutes to freeze out your computer.


You may be able to force Windows to force-close all TCP connections by 1) disabling, then 2) re-enabling your network interface. If that works, you can batch-script the steps to execute when needed.

I've poked around for some way to do this via commandline, from the netsh utility (or similar), but I've had no luck so far.

Of course, the best way to fix this is to fix the broken application. Make sure you're trying the latest version of the application; keep bugging the developers; if you're at the latest version already, try locating an older version of the program.