Add CONNECT_TIMEOUT_MILLIS to fix timeout errors.

This commit is contained in:
ShadowKitten 2018-09-13 22:41:21 -06:00
parent d028c281c9
commit 14590ca3ea
No known key found for this signature in database
GPG Key ID: 4BB5E7264CEF9EFA
2 changed files with 2 additions and 0 deletions

View File

@ -56,6 +56,7 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
CompletableFuture<ConnectionRequestBuilder.Result> result = new CompletableFuture<>();
server.initializeGenericBootstrap()
.option(ChannelOption.TCP_NODELAY, true)
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, SERVER_READ_TIMEOUT_SECONDS * 1000)
.handler(new ChannelInitializer<Channel>() {
@Override
protected void initChannel(Channel ch) throws Exception {

View File

@ -89,6 +89,7 @@ public final class ConnectionManager {
ch.pipeline().addLast(Connections.HANDLER, connection);
}
})
.childOption(ChannelOption.CONNECT_TIMEOUT_MILLIS, CLIENT_READ_TIMEOUT_SECONDS * 1000)
.childOption(ChannelOption.TCP_NODELAY, true)
.childOption(ChannelOption.IP_TOS, 0x18)
.localAddress(address);