David Mokon Bond
David Mokon Bond

Reputation: 1656

Java TCP options

C/Linux has the following...

TCP_KEEPCNT (since Linux 2.4) The maximum number of keepalive probes TCP should send before dropping the con- nection. This option should not be used in code intended to be portable.

   TCP_KEEPIDLE (since Linux 2.4)
          The time (in seconds) the connection needs to remain idle

before TCP starts send- ing keepalive probes, if the socket option SO_KEEPALIVE has been set on this socket. This option should not be used in code intended to be portable.

   TCP_KEEPINTVL (since Linux 2.4)
          The time (in seconds) between individual keepalive probes.  

This option should not be used in code intended to be portable.

I know there are portability issues with these but is there anyway to alter these in Java on a Socket?

Upvotes: 2

Views: 1239

Answers (1)

hhafez
hhafez

Reputation: 39750

doesn't look like something you can readily change from Java, a JNA/JNI wrapper around the C api probably your safest bet.

Upvotes: 2

Related Questions