Is it possible for a TCP connection to remain open when the client has disconnected

tcpwindows-server-2008

We have a server application which is facing TCP exhaustion problems at around 4000 connections. This will occur every 3 or 4 weeks (approximately). The vendor, which has created this server application tells us after examining the output of netstat -b that some connections are remaining open even if the clients have dropped.

I've been given the task of investigating why a particular client application is not closing the TCP connection properly. I'm of the belief that if a client computer is shut down, that it can not POSSIBLY report from the server that a TCP connection is still established with that client. Unfortunately, I can not find any information to validate my view. I don't want to waste any more time investigating a potential problem that I don't think can even be a problem.

tldr;

Can a server report an established connection to a computer that is turned off?

Best Answer

TCP makes no effort to detect a dead connection except on a side that is transmitting data. It is the responsibility of the application code calling into the TCP stack to do this. What protocol is involved here? (The one on top of TCP.)

It's a horrifically ugly "solution", but you can enable TCP keepalives. There's more in this article.

Related Topic