Interesting to note that I usually have the exact reverse problem: Windows Client Access sessions drop but tn5250 marches on perfectly.
In linux there are three tcp keepalive settings: tcp_keepalive_intvl, tcp_keepalive_probes, and tcp_keepalive_time in /proc/sys/net/ipv4 (at least there are on kernel 22.214.171.124). Might these be something like what you are looking for? I thought I remembered seeing an option to setsockopt that would set the tcp keepalive per socket but a quick review of the man page turns up nothing (other than referencing the /proc settings I listed above).
if you want to understand why that is, there are many good books on
the design of operating systems. please pass them along to redmond
when you're done reading them :)
- Paul Davis on ardour-dev