Drops even when busy, or only when idle?
Putting settings into /proc/ for keepalives isn't too great an idea since it will apply to
all your connections, even ones which don't need it, increasing your bandwidth a lot. Getting the right combination of settings to do what you actually want can be tricky, too.
I usually use
libkeepalive when I need to connect to something with obnoxious timeouts. It can be applied to a single program, works for anything(intercepting
socket calls to impose default keepalive settings when a program creates a TCP socket) and is relatively easy to configure.