0

I am trying test a server where we reduced the keepalive params (default 7200 sec to 300) on RHEL. I was setting:

    try {
        Socket tstSocket = new Socket(serverName, portNum);
        PrintWriter out = new PrintWriter(tstSocket.getOutputStream(), true);
        tstSocket.setKeepAlive(true);

and wait 10min and check:

        out.println("output");
        if (out.checkError()){
            System.out.println("Socket closed");
            }

But if I set the setKeepAlive to true (should I just take this out?), does this mean the keepalivetime is no longer used? (from the definition below)

tcp_keepalive_time - the interval between the last data packet sent (simple ACKs are not considered data) and the first keepalive probe; after the connection is marked to need keepalive, this counter is not used any further.

Seattle427
  • 31
  • 3
  • Whats the problem statement? Its not clear.. – Prabhu Oct 12 '16 at 18:01
  • If I set: .setKeepAlive(true); does that mean the current setting of tcp_keepalive_time = 300 is no longer used and will always be kept alive beyond the 300s setting? – Seattle427 Oct 12 '16 at 18:41

0 Answers0