geforkt von Mirrors/Velocity
Ensure the proxy doesn't shut down too early if stdin is EOF.
Dieser Commit ist enthalten in:
Ursprung
b881e9cf04
Commit
df7eb4ade0
@ -45,5 +45,10 @@ public class Velocity {
|
||||
double bootTime = (System.currentTimeMillis() - startTime) / 1000d;
|
||||
logger.info("Done ({}s)!", new DecimalFormat("#.##").format(bootTime));
|
||||
server.getConsoleCommandSource().start();
|
||||
|
||||
// If we don't have a console available (because SimpleTerminalConsole returned), then we still
|
||||
// need to wait, otherwise the JVM will reap us as no non-daemon threads will be active once the
|
||||
// main thread exits.
|
||||
server.awaitProxyShutdown();
|
||||
}
|
||||
}
|
||||
|
@ -138,6 +138,10 @@ public class VelocityServer implements ProxyServer {
|
||||
return commandManager;
|
||||
}
|
||||
|
||||
void awaitProxyShutdown() {
|
||||
cm.getBossGroup().terminationFuture().syncUninterruptibly();
|
||||
}
|
||||
|
||||
@EnsuresNonNull({"serverKeyPair", "servers", "pluginManager", "eventManager", "scheduler",
|
||||
"console", "cm", "configuration"})
|
||||
void start() {
|
||||
|
@ -160,6 +160,10 @@ public final class ConnectionManager {
|
||||
}
|
||||
}
|
||||
|
||||
public EventLoopGroup getBossGroup() {
|
||||
return bossGroup;
|
||||
}
|
||||
|
||||
public ServerChannelInitializerHolder getServerChannelInitializer() {
|
||||
return this.serverChannelInitializer;
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren