Package io.servicetalk.http.netty
Class H2KeepAlivePolicies
java.lang.Object
io.servicetalk.http.netty.H2KeepAlivePolicies
A factory to create
H2ProtocolConfig.KeepAlivePolicy
instances.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
A builder ofH2ProtocolConfig.KeepAlivePolicy
. -
Method Summary
Modifier and TypeMethodDescriptiondisabled()
Returns aH2ProtocolConfig.KeepAlivePolicy
that disables all keep alive behaviors.whenIdleFor
(Duration idleDuration) Returns aH2ProtocolConfig.KeepAlivePolicy
that sends a ping if the channel is idle for the passedidleDuration
.whenIdleFor
(Duration idleDuration, Duration ackTimeout) Returns aH2ProtocolConfig.KeepAlivePolicy
that sends a ping if the channel is idle for the passedidleDuration
and waits forackTimeout
for an ack for that ping.
-
Method Details
-
disabled
Returns aH2ProtocolConfig.KeepAlivePolicy
that disables all keep alive behaviors.- Returns:
- A
H2ProtocolConfig.KeepAlivePolicy
that disables all keep alive behaviors.
-
whenIdleFor
Returns aH2ProtocolConfig.KeepAlivePolicy
that sends a ping if the channel is idle for the passedidleDuration
. Default values are used for other parameters of the returnedH2ProtocolConfig.KeepAlivePolicy
.- Parameters:
idleDuration
-Duration
of idleness on a connection after which a ping is sent.- Returns:
- A
H2ProtocolConfig.KeepAlivePolicy
that sends a ping if the channel is idle for the passedidleDuration
. - See Also:
-
whenIdleFor
public static H2ProtocolConfig.KeepAlivePolicy whenIdleFor(Duration idleDuration, Duration ackTimeout) Returns aH2ProtocolConfig.KeepAlivePolicy
that sends a ping if the channel is idle for the passedidleDuration
and waits forackTimeout
for an ack for that ping. Default values are used for other parameters of the returnedH2ProtocolConfig.KeepAlivePolicy
.- Parameters:
idleDuration
-Duration
of idleness on a connection after which a ping is sent. This value is recommended to be greater than or equal toackTimeout
.ackTimeout
-Duration
to wait for an acknowledgment of a previously sent ping. This value is recommended to be less than or equal toidleDuration
.- Returns:
- A
H2ProtocolConfig.KeepAlivePolicy
that sends a ping if the channel is idle for the passedidleDuration
and waits forackTimeout
for an ack for that ping - See Also:
-