File tree Expand file tree Collapse file tree
core/src/main/java/io/grpc/internal
netty/src/main/java/io/grpc/netty
okhttp/src/main/java/io/grpc/okhttp Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -241,6 +241,12 @@ public byte[] parseAsciiString(byte[] serialized) {
241241 */
242242 public static final long DEFAULT_SERVER_KEEPALIVE_TIMEOUT_NANOS = TimeUnit .SECONDS .toNanos (20L );
243243
244+ /**
245+ * The default minimum time between client keepalive pings permitted by server.
246+ */
247+ public static final long DEFAULT_SERVER_PERMIT_KEEPALIVE_TIME_NANOS
248+ = TimeUnit .MINUTES .toNanos (5L );
249+
244250 /**
245251 * The magic keepalive time value that disables keepalive.
246252 */
Original file line number Diff line number Diff line change 2222import static io .grpc .internal .GrpcUtil .DEFAULT_MAX_MESSAGE_SIZE ;
2323import static io .grpc .internal .GrpcUtil .DEFAULT_SERVER_KEEPALIVE_TIMEOUT_NANOS ;
2424import static io .grpc .internal .GrpcUtil .DEFAULT_SERVER_KEEPALIVE_TIME_NANOS ;
25+ import static io .grpc .internal .GrpcUtil .DEFAULT_SERVER_PERMIT_KEEPALIVE_TIME_NANOS ;
2526import static io .grpc .internal .GrpcUtil .SERVER_KEEPALIVE_TIME_NANOS_DISABLED ;
2627
2728import com .google .common .annotations .VisibleForTesting ;
@@ -113,7 +114,7 @@ public final class NettyServerBuilder extends ForwardingServerBuilder<NettyServe
113114 private long maxConnectionAgeInNanos = MAX_CONNECTION_AGE_NANOS_DISABLED ;
114115 private long maxConnectionAgeGraceInNanos = MAX_CONNECTION_AGE_GRACE_NANOS_INFINITE ;
115116 private boolean permitKeepAliveWithoutCalls ;
116- private long permitKeepAliveTimeInNanos = TimeUnit . MINUTES . toNanos ( 5 ) ;
117+ private long permitKeepAliveTimeInNanos = DEFAULT_SERVER_PERMIT_KEEPALIVE_TIME_NANOS ;
117118 private int maxRstCount ;
118119 private long maxRstPeriodNanos ;
119120 private Attributes eagAttributes = Attributes .EMPTY ;
Original file line number Diff line number Diff line change 1818
1919import static com .google .common .base .Preconditions .checkArgument ;
2020import static io .grpc .internal .CertificateUtils .createTrustManager ;
21+ import static io .grpc .internal .GrpcUtil .DEFAULT_SERVER_PERMIT_KEEPALIVE_TIME_NANOS ;
2122
2223import com .google .common .base .Preconditions ;
2324import com .google .errorprone .annotations .CanIgnoreReturnValue ;
@@ -137,7 +138,7 @@ public InternalServer buildClientTransportServers(
137138 int maxInboundMessageSize = GrpcUtil .DEFAULT_MAX_MESSAGE_SIZE ;
138139 long maxConnectionIdleInNanos = MAX_CONNECTION_IDLE_NANOS_DISABLED ;
139140 boolean permitKeepAliveWithoutCalls ;
140- long permitKeepAliveTimeInNanos = TimeUnit . MINUTES . toNanos ( 5 ) ;
141+ long permitKeepAliveTimeInNanos = DEFAULT_SERVER_PERMIT_KEEPALIVE_TIME_NANOS ;
141142 long maxConnectionAgeInNanos = MAX_CONNECTION_AGE_NANOS_DISABLED ;
142143 long maxConnectionAgeGraceInNanos = MAX_CONNECTION_AGE_GRACE_NANOS_INFINITE ;
143144 int maxConcurrentCallsPerConnection = MAX_CONCURRENT_STREAMS ;
You can’t perform that action at this time.
0 commit comments