writeAndFlush

This commit is contained in:
Gravit 2018-10-01 14:48:53 +07:00
parent fdb7da1460
commit 7f952af1b9
2 changed files with 2 additions and 2 deletions

View file

@ -20,7 +20,7 @@ public String getType() {
@Override @Override
public void execute(ChannelHandlerContext ctx, WebSocketFrame frame) { public void execute(ChannelHandlerContext ctx, WebSocketFrame frame) {
LogHelper.info("Echo: %s",echo); 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 public class Result
{ {

View file

@ -67,7 +67,7 @@ public void execute(ChannelHandlerContext ctx, WebSocketFrame frame) throws Exce
server.config.hwidHandler.check(hwid, result.username); server.config.hwidHandler.check(hwid, result.username);
} catch (AuthException | HWIDException e) } 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 public class ErrorResult