diff --git a/servicetalk-examples/grpc/keepalive/src/main/java/io/servicetalk/examples/grpc/keepalive/KeepAliveClient.java b/servicetalk-examples/grpc/keepalive/src/main/java/io/servicetalk/examples/grpc/keepalive/KeepAliveClient.java index b936c58b73..44502bb3cb 100644 --- a/servicetalk-examples/grpc/keepalive/src/main/java/io/servicetalk/examples/grpc/keepalive/KeepAliveClient.java +++ b/servicetalk-examples/grpc/keepalive/src/main/java/io/servicetalk/examples/grpc/keepalive/KeepAliveClient.java @@ -42,8 +42,8 @@ public static void main(String... args) throws Exception { // Using the default value is suitable in most scenarios, but if you want to customize the value // consider how many resources (network traffic, CPU for local timer management) vs time to detect // bad connection. - // By default, keep alive is only sent when no traffic is detected, so if both peers have keep alive - // the faster interval will be the primary sender. + // The keep alive is only sent when no traffic is detected, so if both peers have keep alive the + // faster interval will be the primary sender. h2().keepAlivePolicy(whenIdleFor(ofSeconds(4))) // Enable frame logging so we can see the PING frames sent/received. .enableFrameLogging("servicetalk-examples-h2-frame-logger", TRACE, () -> true) diff --git a/servicetalk-examples/grpc/keepalive/src/main/java/io/servicetalk/examples/grpc/keepalive/KeepAliveServer.java b/servicetalk-examples/grpc/keepalive/src/main/java/io/servicetalk/examples/grpc/keepalive/KeepAliveServer.java index 27fdaa9c7d..a11b31edd3 100644 --- a/servicetalk-examples/grpc/keepalive/src/main/java/io/servicetalk/examples/grpc/keepalive/KeepAliveServer.java +++ b/servicetalk-examples/grpc/keepalive/src/main/java/io/servicetalk/examples/grpc/keepalive/KeepAliveServer.java @@ -18,7 +18,7 @@ import io.servicetalk.concurrent.api.Single; import io.servicetalk.grpc.netty.GrpcServers; -import io.grpc.examples.helloworld.StreamingGreeter.StreamingGreeterService; +import io.grpc.examples.keepalive.StreamingGreeter.StreamingGreeterService; import static io.servicetalk.http.netty.H2KeepAlivePolicies.whenIdleFor; import static io.servicetalk.http.netty.HttpProtocolConfigs.h2; @@ -36,8 +36,8 @@ public static void main(String... args) throws Exception { // Using the default value is suitable in most scenarios, but if you want to customize the value // consider how many resources (network traffic, CPU for local timer management) vs time to detect // bad connection. - // By default, keep alive is only sent when no traffic is detected, so if both peers have keep alive - // the faster interval will be the primary sender. + // The keep alive is only sent when no traffic is detected, so if both peers have keep alive the + // faster interval will be the primary sender. h2().keepAlivePolicy(whenIdleFor(ofSeconds(6))) // Enable frame logging so we can see the PING frames sent/received. .enableFrameLogging("servicetalk-examples-h2-frame-logger", TRACE, () -> true)