Package io.servicetalk.http.netty
Class H2KeepAlivePolicies.KeepAlivePolicyBuilder
java.lang.Object
io.servicetalk.http.netty.H2KeepAlivePolicies.KeepAlivePolicyBuilder
- Enclosing class:
- H2KeepAlivePolicies
A builder of
H2ProtocolConfig.KeepAlivePolicy
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionackTimeout
(Duration ackTimeout) build()
Build a newH2ProtocolConfig.KeepAlivePolicy
.idleDuration
(Duration idleDuration) withoutActiveStreams
(boolean withoutActiveStreams)
-
Constructor Details
-
KeepAlivePolicyBuilder
public KeepAlivePolicyBuilder()
-
-
Method Details
-
idleDuration
Set theDuration
of idleness on a connection after which a ping is sent.Too short ping durations can be used for testing but may cause unnecessarily high network traffic in real environments.
Duration.ZERO
disables keep-alivePING
frames.- Parameters:
idleDuration
-Duration
of idleness on a connection after which a ping is sent orDuration.ZERO
to disable keep-alivePING
frames.- Returns:
this
.- See Also:
-
ackTimeout
Set the maximumDuration
to wait for an acknowledgment of a previously sent ping. If no acknowledgment is received, within the configured timeout, a connection will be closed.This duration must be positive. Too short ack timeout can cause undesirable connection closures. Too long ack timeout can add unnecessary delay when the remote peer is unresponsive or the network connection is broken, because under normal circumstances
PING
frames ara acknowledged immediately. -
withoutActiveStreams
public H2KeepAlivePolicies.KeepAlivePolicyBuilder withoutActiveStreams(boolean withoutActiveStreams) -
build
Build a newH2ProtocolConfig.KeepAlivePolicy
.- Returns:
- new
H2ProtocolConfig.KeepAlivePolicy
.
-