12

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?

6

7 Answers 7

12
+50

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.

2
  • Searching for TIME_WAIT brought me here. Thanks for the explanation and link.
    – Technext
    Aug 13, 2018 at 12:21
  • hi, thanks for the explanation. It still not closing TCP connections. CLOSE_WAIT increasing. I have set Timeout to 30 seconds
    – aadi1295
    May 1, 2019 at 14:10
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.

1
  • I updated the app to latest version, didn't help, and I have a support ticket in with them. I tried to disable in network properties, and also uninstalled in device manager, and the list of WAIT_CLOSE connections was unaffected. This is a list somewhere in the OS that I can't touch it seems.
    – P a u l
    Nov 8, 2009 at 22:16
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.

1
  • i think the program's allowed to override the system setting on the KeepAliveTime parameter, so it may not help, but i agree it might be worth trying. tweaking it may lead to problems with other applications, however. Nov 8, 2009 at 9:55
0

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

2
  • I can't find any additional processes. Closing beyondtv and all it's related processes has no effect. These connections appear with <non-existent> for the process. The process has exited but the connections won't close.
    – P a u l
    Nov 7, 2009 at 6:03
  • I was playing with the answer rating up/down buttons and there is no way to get back to 0, it's either -1 or 1 so I left it at 1. It would be better to have this question with 0 responses at this point since this answer is not helpful -- I used process explorer and tcpview for some time before posting this question.
    – P a u l
    Nov 8, 2009 at 5:52
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.

1
  • I also did that before. Reran the scenario, no effect, problem remains. I am looking at the linksys router however, I will investigate.
    – P a u l
    Nov 8, 2009 at 22:13
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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .