public static class SocketOptions.KeepAliveOptions extends Object
The time granularity of getIdle()
and getInterval()
is seconds.
Modifier and Type | Class and Description |
---|---|
static class |
SocketOptions.KeepAliveOptions.Builder
Builder for
SocketOptions.KeepAliveOptions . |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_COUNT |
static Duration |
DEFAULT_IDLE |
static Duration |
DEFAULT_INTERVAL |
Modifier and Type | Method and Description |
---|---|
static SocketOptions.KeepAliveOptions.Builder |
builder()
Returns a new
SocketOptions.KeepAliveOptions.Builder to construct SocketOptions.KeepAliveOptions . |
int |
getCount()
Returns the maximum number of keepalive probes TCP should send before dropping the connection.
|
Duration |
getIdle()
The time the connection needs to remain idle before TCP starts sending keepalive probes if keepalive is enabled.
|
Duration |
getInterval()
The time between individual keepalive probes.
|
boolean |
isEnabled()
Returns whether to enable TCP keepalive.
|
SocketOptions.KeepAliveOptions.Builder |
mutate()
Returns a builder to create new
SocketOptions.KeepAliveOptions whose settings are replicated from the current
SocketOptions.KeepAliveOptions . |
public static final int DEFAULT_COUNT
public static final Duration DEFAULT_IDLE
public static final Duration DEFAULT_INTERVAL
public static SocketOptions.KeepAliveOptions.Builder builder()
SocketOptions.KeepAliveOptions.Builder
to construct SocketOptions.KeepAliveOptions
.SocketOptions.KeepAliveOptions.Builder
to construct SocketOptions.KeepAliveOptions
.public SocketOptions.KeepAliveOptions.Builder mutate()
SocketOptions.KeepAliveOptions
whose settings are replicated from the current
SocketOptions.KeepAliveOptions
.SocketOptions.KeepAliveOptions.Builder
to create new SocketOptions.KeepAliveOptions
whose settings are replicated from
the current SocketOptions.KeepAliveOptions
public int getCount()
9
.
See also DEFAULT_COUNT
and TCP_KEEPCNT
.public boolean isEnabled()
SocketOptions.SO_KEEPALIVE
public Duration getIdle()
2 hours
. See also @link DEFAULT_IDLE
and TCP_KEEPIDLE
.
The time granularity of is seconds.
public Duration getInterval()
1 second
. See also DEFAULT_INTERVAL
and
TCP_KEEPINTVL
.
The time granularity of is seconds.
Copyright © 2025 lettuce.io. All rights reserved.