fix: receive file bugs

This commit is contained in:
CaiHQ 2021-12-29 11:53:39 +08:00
parent 2ee97ee704
commit c489be8b4a

View File

@ -82,7 +82,7 @@ public class NodeCenterFrameHandler extends SimpleChannelInboundHandler<Object>
try { try {
map = map =
JsonParser.parseReader( JsonParser.parseReader(
new InputStreamReader(new ByteBufInputStream((ByteBuf) frame))) new InputStreamReader(new ByteBufInputStream((ByteBuf) frame)))
.getAsJsonObject(); .getAsJsonObject();
} catch (Exception e) { } catch (Exception e) {
@ -136,7 +136,7 @@ public class NodeCenterFrameHandler extends SimpleChannelInboundHandler<Object>
} }
} }
public void sendMsg(String json) { public synchronized void sendMsg(String json) {
if (ctx != null) { if (ctx != null) {
// System.out.println("[NodeCenterFrame send] TID:" + Thread.currentThread().getId() + " // System.out.println("[NodeCenterFrame send] TID:" + Thread.currentThread().getId() + "
// isOpen:" // isOpen:"