|We encountered a similar problem on VAX. We reduced it by setting a "keepalive-timer" on the telnet service.|
We use the Multinet TCP stack, which has a default keepalive-timer on telnet of over 2 hours. We changed it to be a few minutes.
Check the documention for your TCP stack. The concept is probably similar for all of them.