On Solaris, use ndd to inspect or set tcp settings.
To inspect the keepalive:
ndd -get /dev/tcp tcp_keepalive_interval
The keepalive interval is in miliseconds and the default is 7200000 (2 hours) and is system wide.
To set the keepalive:
ndd -set /dev/tcp tcp_keepalive_interval
nnnnnnn