13

I'm running beyondtv link on xp, connecting to beyondtv a vista host. The Link program hangs after about 20 min, and I have no fix for this. When this happens, using tcpview, I see that the host has about 200 zombie tcp connections left over from the Link connection. I can't clear them, they are from the same non-existent process. The connections hang around until I reboot the host. Rebooting is the only way I have found to reconnect beyondtv Link. I think there is a bug in beyondtv that is causing this, but I can't get any answers on their forums. But at any rate, I would like to know if there is a way to kill all those connections.

Edit: it's actually about 3000 WAIT_CLOSE connections accumulating after about 40 min, and about then the client dies. If I close the server app, all these sockets now show as owned by a -non-existent- process in tcpview. Understandable. But isn't there a way to close them without re-booting?

P a u l
  • 1,355

7 Answers7

13

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

You can automate killing of a connection pattern using AutoHotKey.

7

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.

harrymc
  • 498,455
1

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.

quack quixote
  • 43,504
1

You are probably getting these CLOSE_WAIT sessions because of the program hanging -- I can't tell if you suspect them as the cause, so just wanted to make that clear.

My guess is that they won't hang around forever; probably only for 2 hours and 5 seconds. Can seem like forever, I know. You can try tuning the KeepAliveTime (probably requires one final reboot) for your network connection down to something small, like 5 minutes. That might help them to disappear faster, after your program hangs.

Or if you know you can run the program reliably for, say, 10 minutes at a time, you could just restart it periodically. Don't know if any of those solutions are useful for your particular situation; I agree with ~quack that you should ditch the problematic app version as soon as possible.

0

See if beyondtv is spawning another process that is holding the connections open. Process Explorer will show you if this is happening.

Joe Internet
  • 5,355
0

Is it possible that there is a firewall issue? It might be an incomplete connection being tried and retried.

I would disable all firewalls on both machines, and if there's a router also its internal firewall.

harrymc
  • 498,455
0

Try WinSock XP fix.

http://www.snapfiles.com/get/winsockxpfix.html

It trashes your connection and resets it back to default. I always keep this on a thumb drive when all else fails.

Skaughty
  • 137