examples: add keepalive example#9956
Merged
YifeiZhuang merged 1 commit intogrpc:masterfrom Mar 17, 2023
Merged
Conversation
761a3f1 to
f3461b9
Compare
larry-safran
approved these changes
Mar 17, 2023
Contributor
larry-safran
left a comment
There was a problem hiding this comment.
A few small comments on wording, please look at them.
examples/src/main/java/io/grpc/examples/keepalive/KeepAliveClient.java
Outdated
Show resolved
Hide resolved
examples/src/main/java/io/grpc/examples/keepalive/KeepAliveClient.java
Outdated
Show resolved
Hide resolved
examples/src/main/java/io/grpc/examples/keepalive/KeepAliveClient.java
Outdated
Show resolved
Hide resolved
| // keepAliveTimeout: Wait 1 second for ping ack before considering the connection dead. Set a | ||
| // larger value in reality, e.g. 10s. You may only set such small value(e.g. 1s) in certain | ||
| // low latency environments. | ||
| // keepAliveWithoutCalls: Send pings even without active streams. Normally disable it. |
Contributor
There was a problem hiding this comment.
s/without active stream/when no streams are active/
| // More details see: https://github.com/grpc/proposal/blob/master/A9-server-side-conn-mgt.md | ||
| server = Grpc.newServerBuilderForPort(port, InsecureServerCredentials.create()) | ||
| .addService(new GreeterImpl()) | ||
| .keepAliveTime(5, TimeUnit.SECONDS) |
Contributor
There was a problem hiding this comment.
Should put a comment on the line recommending a reasonable value like you did in the client as some people might not read the long comment above.
f3461b9 to
fefd310
Compare
larry-safran
pushed a commit
to larry-safran/grpc-java
that referenced
this pull request
Mar 20, 2023
larry-safran
pushed a commit
to larry-safran/grpc-java
that referenced
this pull request
Mar 20, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes b/259284839