From 8466894d49a84e04106a098d4fb6935b5f1c374b Mon Sep 17 00:00:00 2001 From: Gravit Date: Wed, 3 Apr 2019 23:49:50 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=97=D0=B0=D0=BA=D1=80=D1=8B=D1=82?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=81=D0=BE=D0=B5=D0=B4=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BF=D1=80=D0=B8=20=D0=B2=D1=8B=D1=85=D0=BE?= =?UTF-8?q?=D0=B4=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../launchserver/socket/NettyServerSocketHandler.java | 1 - .../launcher/request/websockets/LegacyRequestBridge.java | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/NettyServerSocketHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/NettyServerSocketHandler.java index 3b243156..f2f5d5f3 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/NettyServerSocketHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/NettyServerSocketHandler.java @@ -139,7 +139,6 @@ public void run() { public void initChannel(NioSocketChannel ch) { ChannelPipeline pipeline = ch.pipeline(); //p.addLast(new LoggingHandler(LogLevel.INFO)); - System.out.println("P!"); pipeline.addLast(new HttpServerCodec()); pipeline.addLast(new HttpObjectAggregator(65536)); pipeline.addLast(new WebSocketServerCompressionHandler()); diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/LegacyRequestBridge.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/LegacyRequestBridge.java index 73e89432..0fe13dec 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/LegacyRequestBridge.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/LegacyRequestBridge.java @@ -5,6 +5,7 @@ import ru.gravit.launcher.events.request.ErrorRequestEvent; import ru.gravit.launcher.request.RequestException; import ru.gravit.launcher.request.ResultInterface; +import ru.gravit.utils.helper.JVMHelper; import ru.gravit.utils.helper.LogHelper; import java.io.IOException; @@ -44,6 +45,13 @@ public static void initWebSockets(String address) { } catch (InterruptedException e) { e.printStackTrace(); } + JVMHelper.RUNTIME.addShutdownHook(new Thread(() -> { + try { + service.closeBlocking(); + } catch (InterruptedException e) { + LogHelper.error(e); + } + })); } static {