java.lang.Object
io.lettuce.core.SocketOptions.KeepAliveOptions.Builder
- Enclosing class:
- SocketOptions.KeepAliveOptions
public static class SocketOptions.KeepAliveOptions.Builder extends Object
Builder for
SocketOptions.KeepAliveOptions.-
Method Summary
Modifier and Type Method Description SocketOptions.KeepAliveOptionsbuild()Create a new instance ofSocketOptions.KeepAliveOptionsSocketOptions.KeepAliveOptions.Buildercount(int count)Set the the maximum number of keepalive probes TCP should send before dropping the connection.SocketOptions.KeepAliveOptions.Builderdisable()Disable TCP keepalive.SocketOptions.KeepAliveOptions.Builderenable()Enable TCP keepalive.SocketOptions.KeepAliveOptions.Builderenable(boolean enabled)Enable TCP keepalive.SocketOptions.KeepAliveOptions.Builderidle(Duration idle)The time the connection needs to remain idle before TCP starts sending keepalive probes if keepalive is enabled.SocketOptions.KeepAliveOptions.Builderinterval(Duration interval)The time between individual keepalive probes.
-
Method Details
-
count
Set the the maximum number of keepalive probes TCP should send before dropping the connection. Defaults to9. See alsoSocketOptions.KeepAliveOptions.DEFAULT_COUNTandTCP_KEEPCNT.- Parameters:
count- the maximum number of keepalive probes TCP- Returns:
this
-
enable
Enable TCP keepalive. Defaults to disabled. SeeSocketOptions.DEFAULT_SO_KEEPALIVE.- Returns:
this- See Also:
SocketOptions.SO_KEEPALIVE
-
disable
Disable TCP keepalive. Defaults to disabled. SeeSocketOptions.DEFAULT_SO_KEEPALIVE.- Returns:
this- See Also:
SocketOptions.SO_KEEPALIVE
-
enable
Enable TCP keepalive. Defaults tofalse. SeeSocketOptions.DEFAULT_SO_KEEPALIVE.- Parameters:
enabled- whether to enable TCP keepalive.- Returns:
this- See Also:
SocketOptions.SO_KEEPALIVE
-
idle
The time the connection needs to remain idle before TCP starts sending keepalive probes if keepalive is enabled. Defaults to2 hours. See also @linkSocketOptions.KeepAliveOptions.DEFAULT_IDLEandTCP_KEEPIDLE.The time granularity of is seconds.
- Parameters:
idle- connection idle time, must be greater 0.- Returns:
this
-
interval
The time between individual keepalive probes. Defaults to75 second. See alsoSocketOptions.KeepAliveOptions.DEFAULT_INTERVALandTCP_KEEPINTVL.The time granularity of is seconds.
- Parameters:
interval- connection interval time, must be greater 0- Returns:
this
-
build
Create a new instance ofSocketOptions.KeepAliveOptions- Returns:
- new instance of
SocketOptions.KeepAliveOptions
-