Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
Isn't there a way to start a bounty on questions here? I don't see a button for that. –  P a u l Nov 8 '09 at 5:59
    
you can offer a bounty after the question's been up for 2 days: superuser.com/faq –  quack quixote Nov 8 '09 at 6:27
2  
Fire. Fire or a shotgun. –  Phoshi Nov 8 '09 at 11:36
    
@phoshi: or nuke it from orbit. it's the only way to be sure. –  quack quixote Nov 8 '09 at 20:41
1  
I prefer to do my killing the doom way: superuser.com/questions/54937/3d-windows-managers/55130#55130 –  DaveParillo Nov 13 '09 at 6:15

7 Answers 7

up vote 5 down vote accepted
+50

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

You can automate killing of a connection pattern using AutoHotKey.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer
    
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. –  quack quixote Nov 8 '09 at 9:55

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

share|improve this answer
    
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 '09 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 '09 at 5:52

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.

share|improve this answer
    
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 '09 at 22:16

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.

share|improve this answer
    
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 '09 at 22:13

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.