Fix warning when using a Unix domain socket to connect to a server

This commit is contained in:
Andrew Steinborn
2021-05-12 09:15:37 -04:00
parent 47a1332514
commit 11928f3737

View File

@@ -182,14 +182,16 @@ public final class ConnectionManager {
public Bootstrap createWorker(@Nullable EventLoopGroup group, SocketAddress target) {
Bootstrap bootstrap = new Bootstrap()
.channelFactory(this.transportType.getClientChannelFactory(target))
.option(ChannelOption.TCP_NODELAY, true)
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS,
this.server.configuration().getConnectTimeout())
.group(group == null ? this.workerGroup : group)
.resolver(this.resolver.asGroup());
if (target instanceof InetSocketAddress) {
bootstrap.option(ChannelOption.TCP_NODELAY, true);
if (transportType == TransportType.EPOLL && server.configuration().useTcpFastOpen()) {
bootstrap.option(EpollChannelOption.TCP_FASTOPEN_CONNECT, true);
}
}
return bootstrap;
}