public final class NettyChannelBuilder extends AbstractChannelBuilder<NettyChannelBuilder>
AbstractChannelBuilder.ChannelEssentials| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CONNECTION_WINDOW_SIZE |
static int |
DEFAULT_STREAM_WINDOW_SIZE |
| Modifier and Type | Method and Description |
|---|---|
protected AbstractChannelBuilder.ChannelEssentials |
buildEssentials() |
NettyChannelBuilder |
channelType(Class<? extends Channel> channelType)
Specify the channel type to use, by default we use
NioSocketChannel. |
NettyChannelBuilder |
connectionWindowSize(int connectionWindowSize)
Sets the HTTP/2 connection flow control window.
|
NettyChannelBuilder |
eventLoopGroup(EventLoopGroup group)
Provides an EventGroupLoop to be used by the netty transport.
|
static NettyChannelBuilder |
forAddress(SocketAddress serverAddress)
Creates a new builder with the given server address.
|
static NettyChannelBuilder |
forAddress(String host,
int port)
Creates a new builder with the given host and port.
|
NettyChannelBuilder |
negotiationType(NegotiationType type)
Sets the negotiation type for the HTTP/2 connection.
|
NettyChannelBuilder |
sslContext(SslContext sslContext)
SSL/TLS context to use instead of the system default.
|
NettyChannelBuilder |
streamWindowSize(int streamWindowSize)
Sets the HTTP/2 per-stream flow control window.
|
build, executorpublic static final int DEFAULT_CONNECTION_WINDOW_SIZE
public static final int DEFAULT_STREAM_WINDOW_SIZE
public static NettyChannelBuilder forAddress(SocketAddress serverAddress)
public static NettyChannelBuilder forAddress(String host, int port)
public NettyChannelBuilder channelType(Class<? extends Channel> channelType)
NioSocketChannel.public NettyChannelBuilder negotiationType(NegotiationType type)
Default: TLS
public NettyChannelBuilder eventLoopGroup(EventLoopGroup group)
It's an optional parameter. If the user has not provided an EventGroupLoop when the channel is built, the builder will use the default one which is static.
The channel won't take ownership of the given EventLoopGroup. It's caller's responsibility to shut it down when it's desired.
public NettyChannelBuilder sslContext(SslContext sslContext)
GrpcSslContexts, but options could have been overridden.public NettyChannelBuilder connectionWindowSize(int connectionWindowSize)
DEFAULT_CONNECTION_WINDOW_SIZE).public NettyChannelBuilder streamWindowSize(int streamWindowSize)
DEFAULT_STREAM_WINDOW_SIZE).protected AbstractChannelBuilder.ChannelEssentials buildEssentials()
buildEssentials in class AbstractChannelBuilder<NettyChannelBuilder>