public final class NettyChannelBuilder extends io.grpc.AbstractChannelBuilder<NettyChannelBuilder>
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_FLOW_CONTROL_WINDOW |
Modifier and Type | Method and Description |
---|---|
protected io.grpc.AbstractChannelBuilder.ChannelEssentials |
buildEssentials() |
NettyChannelBuilder |
channelType(Class<? extends Channel> channelType)
Specify the channel type to use, by default we use
NioSocketChannel . |
NettyChannelBuilder |
eventLoopGroup(EventLoopGroup group)
Provides an EventGroupLoop to be used by the netty transport.
|
NettyChannelBuilder |
flowControlWindow(int flowControlWindow)
Sets the flow control window in bytes.
|
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.
|
public static final int DEFAULT_FLOW_CONTROL_WINDOW
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 flowControlWindow(int flowControlWindow)
DEFAULT_FLOW_CONTROL_WINDOW
).protected io.grpc.AbstractChannelBuilder.ChannelEssentials buildEssentials()
buildEssentials
in class io.grpc.AbstractChannelBuilder<NettyChannelBuilder>