Detecting Hangup

Let&rsquo;s suppose you create a TCP connection but may not use it for some time, for example in a preconnected pool of TCP connections. When you eventually go to use it, there&rsquo;s a possibility that the other end has already decided to hang up and close the connection - at which point you&rsquo;d like to either pull another connection, establish an entirely fresh connection, or take some…