#2752: Configurable connect and ping timeouts

This commit is contained in:
Mystiflow
2020-01-25 11:11:30 +11:00
committed by md_5
parent 70370faf5d
commit 0a4b9b4984
5 changed files with 23 additions and 11 deletions

View File

@@ -183,7 +183,7 @@ public class BungeeServerInfo implements ServerInfo
.channel( PipelineUtils.getChannel( socketAddress ) )
.group( BungeeCord.getInstance().eventLoops )
.handler( PipelineUtils.BASE )
.option( ChannelOption.CONNECT_TIMEOUT_MILLIS, 5000 ) // TODO: Configurable
.option( ChannelOption.CONNECT_TIMEOUT_MILLIS, BungeeCord.getInstance().getConfig().getRemotePingTimeout() )
.remoteAddress( socketAddress )
.connect()
.addListener( listener );

View File

@@ -55,6 +55,8 @@ public class Configuration implements ProxyConfig
private int remotePingCache = -1;
private int playerLimit = -1;
private Collection<String> disabledCommands;
private int serverConnectTimeout = 5000;
private int remotePingTimeout = 5000;
private int throttle = 4000;
private int throttleLimit = 3;
private boolean ipForward;
@@ -88,6 +90,8 @@ public class Configuration implements ProxyConfig
logPings = adapter.getBoolean( "log_pings", logPings );
remotePingCache = adapter.getInt( "remote_ping_cache", remotePingCache );
playerLimit = adapter.getInt( "player_limit", playerLimit );
serverConnectTimeout = adapter.getInt( "server_connect_timeout", serverConnectTimeout );
remotePingTimeout = adapter.getInt( "remote_ping_timeout", remotePingTimeout );
throttle = adapter.getInt( "connection_throttle", throttle );
throttleLimit = adapter.getInt( "connection_throttle_limit", throttleLimit );
ipForward = adapter.getBoolean( "ip_forward", ipForward );