3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 05:20:14 +01:00

Change to a 5 second connection timeout.

Dieser Commit ist enthalten in:
PurpleIsEverything 2018-09-13 22:53:23 -06:00
Ursprung 14590ca3ea
Commit cf46659d9e
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4BB5E7264CEF9EFA
3 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -33,6 +33,7 @@ import static com.velocitypowered.proxy.network.Connections.HANDLER;
import static com.velocitypowered.proxy.network.Connections.MINECRAFT_DECODER;
import static com.velocitypowered.proxy.network.Connections.MINECRAFT_ENCODER;
import static com.velocitypowered.proxy.network.Connections.READ_TIMEOUT;
import static com.velocitypowered.proxy.network.Connections.CONNECTION_TIMEOUT_SECONDS;
import static com.velocitypowered.proxy.network.Connections.SERVER_READ_TIMEOUT_SECONDS;
public class VelocityServerConnection implements MinecraftConnectionAssociation, ServerConnection {
@ -56,7 +57,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)
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, CONNECTION_TIMEOUT_SECONDS * 1000)
.handler(new ChannelInitializer<Channel>() {
@Override
protected void initChannel(Channel ch) throws Exception {

Datei anzeigen

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

Datei anzeigen

@ -16,4 +16,5 @@ public interface Connections {
int CLIENT_READ_TIMEOUT_SECONDS = 30; // client -> proxy
int SERVER_READ_TIMEOUT_SECONDS = 30; // proxy -> server
int CONNECTION_TIMEOUT_SECONDS = 5;
}