TCP Keep Alive probes

Discussion in 'Java' started by grant_holler@yahoo.com, Jul 10, 2005.

  1. Guest

    Hi All,

    I have a java client app and want to send TCP Keep Alive probes to my
    server every 10 minutes as opposed to the default 2 hours. I see a
    setKeepAlive() call in the API, but that only turns on whether you want
    to send Keep Alives or not. How do i specify the Keep Alive probe
    interval?

    Thanks,

    Grant.
    , Jul 10, 2005
    #1
    1. Advertising

  2. wrote:
    > Hi All,
    >
    > I have a java client app and want to send TCP Keep Alive probes to my
    > server every 10 minutes as opposed to the default 2 hours. I see a
    > setKeepAlive() call in the API, but that only turns on whether you want
    > to send Keep Alives or not. How do i specify the Keep Alive probe
    > interval?


    (a) TCP keep-alive is not what you think it is. It is a mechanism to
    keep the TCP connection below the application alive (prevent that
    timeouts kill the idle connection). It is not a mechanism to verify the
    application layer end-to-end. E.g. the TCP/IP stack below a
    server-process that hangs still processes the superfluous segments and
    ACKs them, thus keeping the TCP connection alive while the server in
    fact no longer works. On the other hand, missing keep-alive ACKs can't
    be interpreted as connection failure, since empty ACKs are not reliable.

    (b) The standard requires a minimum(!) of 2 hours. Any implementation
    supporting smaller intervals is broken.

    (c) Consider implementing a heartbeat on the application layer if you
    really need to reliably know that your server-application is alive .

    (d) If you work with a heartbeat consider doing it separately from your
    application connections and instead use some separate management
    protocol.

    (e) If you don't need to know that your server is alive all the time,
    just don't care about a connection. If you need to connect to the server
    and you still have an open connection use it. If not, don't make a big
    fuss and just establish a new one. Keeping connections alive for no
    apparent reason is just a waste of network resources. So only have
    connections to the server if you need one.

    /Thomas

    --
    The comp.lang.java.gui FAQ:
    ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
    http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
    Thomas Weidenfeller, Jul 11, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luiz Alberto Gibson da Costa

    web chat development, http header connection: keep-alive

    Luiz Alberto Gibson da Costa, Aug 6, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    605
    Luiz Alberto Gibson da Costa
    Aug 6, 2003
  2. twscott
    Replies:
    1
    Views:
    5,042
  3. Herman

    Keep JVM alive with JNI

    Herman, May 24, 2004, in forum: Java
    Replies:
    6
    Views:
    1,108
    Herman
    May 27, 2004
  4. Naresh Agarwal
    Replies:
    1
    Views:
    1,054
    ExGuardianReader
    May 29, 2004
  5. hisan
    Replies:
    1
    Views:
    1,319
    Dan Stromberg
    Jun 25, 2012
Loading...

Share This Page