mirror of
https://github.com/PaperMC/Velocity.git
synced 2026-02-17 14:37:43 +01:00
Fix warning when using a Unix domain socket to connect to a server
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user