diff --git a/detection/src/main/java/com/njcn/gather/detection/util/socket/service/NettyServerHandler.java b/detection/src/main/java/com/njcn/gather/detection/util/socket/service/NettyServerHandler.java index dd143b70..a8eea77c 100644 --- a/detection/src/main/java/com/njcn/gather/detection/util/socket/service/NettyServerHandler.java +++ b/detection/src/main/java/com/njcn/gather/detection/util/socket/service/NettyServerHandler.java @@ -43,10 +43,27 @@ public class NettyServerHandler extends SimpleChannelInboundHandler { }else{ channel.writeAndFlush("socket指令结果:成功指令"); }*/ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("requestId","yjc_ytxjy"); - jsonObject.put("code","10200"); - channel.writeAndFlush(jsonObject.toJSONString()+'\n'); + if(!msg.contains("HeartBeat")){ + JSONObject jsonObject1 = new JSONObject(); + jsonObject1.put("requestId","yjc_ytxjy"); + jsonObject1.put("operateCode","INIT_GATHER"); + jsonObject1.put("code","10201"); + channel.writeAndFlush(jsonObject1.toJSONString()+'\n'); + + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + + JSONObject jsonObject = new JSONObject(); + jsonObject.put("requestId","yjc_ytxjy"); + jsonObject.put("operateCode","INIT_GATHER"); + jsonObject.put("code","10200"); + channel.writeAndFlush(jsonObject.toJSONString()+'\n'); + } + + } @Override