From 7f952af1b96c75d9caef81780c57cff433d3a60e Mon Sep 17 00:00:00 2001 From: Gravit Date: Mon, 1 Oct 2018 14:48:53 +0700 Subject: [PATCH] writeAndFlush --- .../gravit/launchserver/socket/websocket/json/EchoResponse.java | 2 +- .../launchserver/socket/websocket/json/auth/AuthResponse.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/EchoResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/EchoResponse.java index b905fcdd..50197c0e 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/EchoResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/EchoResponse.java @@ -20,7 +20,7 @@ public String getType() { @Override public void execute(ChannelHandlerContext ctx, WebSocketFrame frame) { LogHelper.info("Echo: %s",echo); - ctx.channel().write(WebSocketFrameHandler.gson.toJson(new Result(echo))); + ctx.channel().writeAndFlush(WebSocketFrameHandler.gson.toJson(new Result(echo))); } public class Result { diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/auth/AuthResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/auth/AuthResponse.java index 4e6f46ac..1a6e538c 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/auth/AuthResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/auth/AuthResponse.java @@ -67,7 +67,7 @@ public void execute(ChannelHandlerContext ctx, WebSocketFrame frame) throws Exce server.config.hwidHandler.check(hwid, result.username); } catch (AuthException | HWIDException e) { - ctx.channel().write(WebSocketFrameHandler.gson.toJson(new ErrorResult(e.getMessage()))); + ctx.channel().writeAndFlush(WebSocketFrameHandler.gson.toJson(new ErrorResult(e.getMessage()))); } } public class ErrorResult