@Test public void failIfKeepAliveTimeoutNegative() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("keepalive timeout must be positive"); builder.keepAliveTimeout(-10L, TimeUnit.HOURS); }
public NettyServerBuilder keepAliveTimeout(long keepAliveTimeout, TimeUnit timeUnit) { checkArgument(keepAliveTimeout > 0L, "keepalive timeout must be positive"); keepAliveTimeoutInNanos = timeUnit.toNanos(keepAliveTimeout); keepAliveTimeoutInNanos = KeepAliveManager.clampKeepAliveTimeoutInNanos(keepAliveTimeoutInNanos); if (keepAliveTimeoutInNanos < MIN_KEEPALIVE_TIMEOUT_NANO) { keepAliveTimeoutInNanos = MIN_KEEPALIVE_TIMEOUT_NANO; } return this; }
NettyServerBuilder extends AbstractServerImplBuilder<NettyServerBuilder> { public NettyServerBuilder keepAliveTimeout(long keepAliveTimeout, TimeUnit timeUnit) { checkArgument(keepAliveTimeout > 0L, "keepalive timeout must be positive"); keepAliveTimeoutInNanos = timeUnit.toNanos(keepAliveTimeout); keepAliveTimeoutInNanos = KeepAliveManager.clampKeepAliveTimeoutInNanos(keepAliveTimeoutInNanos); if (keepAliveTimeoutInNanos < MIN_KEEPALIVE_TIMEOUT_NANO) { keepAliveTimeoutInNanos = MIN_KEEPALIVE_TIMEOUT_NANO; } return this; } }
NettyServerBuilder extends AbstractServerImplBuilder<NettyServerBuilder> { public NettyServerBuilder keepAliveTimeout(long keepAliveTimeout, TimeUnit timeUnit) { checkArgument(keepAliveTimeout > 0L, "keepalive timeout must be positive"); keepAliveTimeoutInNanos = timeUnit.toNanos(keepAliveTimeout); keepAliveTimeoutInNanos = KeepAliveManager.clampKeepAliveTimeoutInNanos(keepAliveTimeoutInNanos); if (keepAliveTimeoutInNanos < MIN_KEEPALIVE_TIMEOUT_NANO) { keepAliveTimeoutInNanos = MIN_KEEPALIVE_TIMEOUT_NANO; } return this; } @CheckReturnValue private  NettyServerBuilder(int port); @CheckReturnValue private  NettyServerBuilder(SocketAddress address); }
NettyServerBuilder extends AbstractServerImplBuilder<NettyServerBuilder> { public NettyServerBuilder keepAliveTimeout(long keepAliveTimeout, TimeUnit timeUnit) { checkArgument(keepAliveTimeout > 0L, "keepalive timeout must be positive"); keepAliveTimeoutInNanos = timeUnit.toNanos(keepAliveTimeout); keepAliveTimeoutInNanos = KeepAliveManager.clampKeepAliveTimeoutInNanos(keepAliveTimeoutInNanos); if (keepAliveTimeoutInNanos < MIN_KEEPALIVE_TIMEOUT_NANO) { keepAliveTimeoutInNanos = MIN_KEEPALIVE_TIMEOUT_NANO; } return this; } @CheckReturnValue private  NettyServerBuilder(int port); @CheckReturnValue private  NettyServerBuilder(SocketAddress address); @CheckReturnValue static NettyServerBuilder forPort(int port); @CheckReturnValue static NettyServerBuilder forAddress(SocketAddress address); NettyServerBuilder channelType(Class<? extends ServerChannel> channelType); NettyServerBuilder withChildOption(ChannelOption<T> option, T value); NettyServerBuilder bossEventLoopGroup(EventLoopGroup group); NettyServerBuilder workerEventLoopGroup(EventLoopGroup group); NettyServerBuilder sslContext(SslContext sslContext); @Internal final NettyServerBuilder protocolNegotiator(
          @Nullable ProtocolNegotiator protocolNegotiator); NettyServerBuilder maxConcurrentCallsPerConnection(int maxCalls); NettyServerBuilder flowControlWindow(int flowControlWindow); @Deprecated NettyServerBuilder maxMessageSize(int maxMessageSize); @Override NettyServerBuilder maxInboundMessageSize(int bytes); @Deprecated NettyServerBuilder maxHeaderListSize(int maxHeaderListSize); @Override NettyServerBuilder maxInboundMetadataSize(int bytes); NettyServerBuilder keepAliveTime(long keepAliveTime, TimeUnit timeUnit); NettyServerBuilder keepAliveTimeout(long keepAliveTimeout, TimeUnit timeUnit); NettyServerBuilder maxConnectionIdle(long maxConnectionIdle, TimeUnit timeUnit); NettyServerBuilder maxConnectionAge(long maxConnectionAge, TimeUnit timeUnit); NettyServerBuilder maxConnectionAgeGrace(long maxConnectionAgeGrace, TimeUnit timeUnit); NettyServerBuilder permitKeepAliveTime(long keepAliveTime, TimeUnit timeUnit); NettyServerBuilder permitKeepAliveWithoutCalls(boolean permit); @Override NettyServerBuilder useTransportSecurity(File certChain, File privateKey); @Override NettyServerBuilder useTransportSecurity(InputStream certChain, InputStream privateKey); }
NettyServerBuilder extends AbstractServerImplBuilder<NettyServerBuilder> { public NettyServerBuilder keepAliveTimeout(long keepAliveTimeout, TimeUnit timeUnit) { checkArgument(keepAliveTimeout > 0L, "keepalive timeout must be positive"); keepAliveTimeoutInNanos = timeUnit.toNanos(keepAliveTimeout); keepAliveTimeoutInNanos = KeepAliveManager.clampKeepAliveTimeoutInNanos(keepAliveTimeoutInNanos); if (keepAliveTimeoutInNanos < MIN_KEEPALIVE_TIMEOUT_NANO) { keepAliveTimeoutInNanos = MIN_KEEPALIVE_TIMEOUT_NANO; } return this; } @CheckReturnValue private  NettyServerBuilder(int port); @CheckReturnValue private  NettyServerBuilder(SocketAddress address); @CheckReturnValue static NettyServerBuilder forPort(int port); @CheckReturnValue static NettyServerBuilder forAddress(SocketAddress address); NettyServerBuilder channelType(Class<? extends ServerChannel> channelType); NettyServerBuilder withChildOption(ChannelOption<T> option, T value); NettyServerBuilder bossEventLoopGroup(EventLoopGroup group); NettyServerBuilder workerEventLoopGroup(EventLoopGroup group); NettyServerBuilder sslContext(SslContext sslContext); @Internal final NettyServerBuilder protocolNegotiator(
          @Nullable ProtocolNegotiator protocolNegotiator); NettyServerBuilder maxConcurrentCallsPerConnection(int maxCalls); NettyServerBuilder flowControlWindow(int flowControlWindow); @Deprecated NettyServerBuilder maxMessageSize(int maxMessageSize); @Override NettyServerBuilder maxInboundMessageSize(int bytes); @Deprecated NettyServerBuilder maxHeaderListSize(int maxHeaderListSize); @Override NettyServerBuilder maxInboundMetadataSize(int bytes); NettyServerBuilder keepAliveTime(long keepAliveTime, TimeUnit timeUnit); NettyServerBuilder keepAliveTimeout(long keepAliveTimeout, TimeUnit timeUnit); NettyServerBuilder maxConnectionIdle(long maxConnectionIdle, TimeUnit timeUnit); NettyServerBuilder maxConnectionAge(long maxConnectionAge, TimeUnit timeUnit); NettyServerBuilder maxConnectionAgeGrace(long maxConnectionAgeGrace, TimeUnit timeUnit); NettyServerBuilder permitKeepAliveTime(long keepAliveTime, TimeUnit timeUnit); NettyServerBuilder permitKeepAliveWithoutCalls(boolean permit); @Override NettyServerBuilder useTransportSecurity(File certChain, File privateKey); @Override NettyServerBuilder useTransportSecurity(InputStream certChain, InputStream privateKey); static final int DEFAULT_FLOW_CONTROL_WINDOW; }