mirror of https://github.com/grpc/grpc-java.git
netty: improve code readability (#6375)
This commit is contained in:
parent
6d3fb53128
commit
1118793bfb
|
@ -64,7 +64,7 @@ class KeepAliveEnforcer {
|
|||
}
|
||||
if (!valid) {
|
||||
pingStrikes++;
|
||||
return !(pingStrikes > MAX_PING_STRIKES);
|
||||
return pingStrikes <= MAX_PING_STRIKES;
|
||||
} else {
|
||||
lastValidPingTime = now;
|
||||
return true;
|
||||
|
|
|
@ -65,7 +65,8 @@ import javax.net.ssl.SSLException;
|
|||
public final class NettyChannelBuilder
|
||||
extends AbstractManagedChannelImplBuilder<NettyChannelBuilder> {
|
||||
|
||||
public static final int DEFAULT_FLOW_CONTROL_WINDOW = 1048576; // 1MiB
|
||||
// 1MiB.
|
||||
public static final int DEFAULT_FLOW_CONTROL_WINDOW = 1024 * 1024;
|
||||
|
||||
private static final long AS_LARGE_AS_INFINITE = TimeUnit.DAYS.toNanos(1000L);
|
||||
|
||||
|
|
|
@ -63,7 +63,8 @@ import javax.net.ssl.SSLException;
|
|||
@CanIgnoreReturnValue
|
||||
public final class NettyServerBuilder extends AbstractServerImplBuilder<NettyServerBuilder> {
|
||||
|
||||
public static final int DEFAULT_FLOW_CONTROL_WINDOW = 1048576; // 1MiB
|
||||
// 1MiB
|
||||
public static final int DEFAULT_FLOW_CONTROL_WINDOW = 1024 * 1024;
|
||||
|
||||
static final long MAX_CONNECTION_IDLE_NANOS_DISABLED = Long.MAX_VALUE;
|
||||
static final long MAX_CONNECTION_AGE_NANOS_DISABLED = Long.MAX_VALUE;
|
||||
|
|
|
@ -34,9 +34,9 @@ import io.netty.buffer.ByteBufAllocator;
|
|||
class NettyWritableBufferAllocator implements WritableBufferAllocator {
|
||||
|
||||
// Use 4k as our minimum buffer size.
|
||||
private static final int MIN_BUFFER = 4096;
|
||||
private static final int MIN_BUFFER = 4 * 1024;
|
||||
|
||||
// Set the maximum buffer size to 1MB
|
||||
// Set the maximum buffer size to 1MB.
|
||||
private static final int MAX_BUFFER = 1024 * 1024;
|
||||
|
||||
private final ByteBufAllocator allocator;
|
||||
|
|
Loading…
Reference in New Issue