From c489be8b4a7a1f7e8d478ca22ead9c87620ed9d8 Mon Sep 17 00:00:00 2001 From: CaiHQ Date: Wed, 29 Dec 2021 11:53:39 +0800 Subject: [PATCH] fix: receive file bugs --- .../org/bdware/server/nodecenter/NodeCenterFrameHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bdware/server/nodecenter/NodeCenterFrameHandler.java b/src/main/java/org/bdware/server/nodecenter/NodeCenterFrameHandler.java index 4496e87..26ebd63 100644 --- a/src/main/java/org/bdware/server/nodecenter/NodeCenterFrameHandler.java +++ b/src/main/java/org/bdware/server/nodecenter/NodeCenterFrameHandler.java @@ -82,7 +82,7 @@ public class NodeCenterFrameHandler extends SimpleChannelInboundHandler try { map = JsonParser.parseReader( - new InputStreamReader(new ByteBufInputStream((ByteBuf) frame))) + new InputStreamReader(new ByteBufInputStream((ByteBuf) frame))) .getAsJsonObject(); } catch (Exception e) { @@ -136,7 +136,7 @@ public class NodeCenterFrameHandler extends SimpleChannelInboundHandler } } - public void sendMsg(String json) { + public synchronized void sendMsg(String json) { if (ctx != null) { // System.out.println("[NodeCenterFrame send] TID:" + Thread.currentThread().getId() + " // isOpen:"