We should not allow a configuration where we time out before we send a
heartbeat. Enforce this invariant.
JIRA: NETCONF-970
Change-Id: Ic26319d7a3da4db9b28fa0aa2e39cdfe439fd786
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
checkArgument(idleTimeout > 0, "Idle timeout must be specified by positive value.");
checkArgument(heartbeatInterval >= 0,
"Heartbeat ping interval must be disabled (0) or specified by positive value.");
+ // we need at least one heartbeat before we time out the socket
+ checkArgument(idleTimeout > heartbeatInterval, "Idle timeout must be greater than heartbeat ping interval.");
}
}
\ No newline at end of file