3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-09-29 14:40:21 +02:00

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

Dieser Commit ist enthalten in:
Andrew Steinborn 2021-05-12 09:15:37 -04:00
Ursprung 47a1332514
Commit 11928f3737

Datei anzeigen

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