-
Notifications
You must be signed in to change notification settings - Fork 4k
examples: add keepalive example #9956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
761a3f1 to
f3461b9
Compare
larry-safran
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
fixes b/259284839