#
Junjie
2025-07-14 471d7b5bc4c8cf7ffeb258f208a66cca202d64de
src/main/java/com/zy/core/thread/fake/FakeNyShuttleThread.java
@@ -95,7 +95,13 @@
                    }
//                    log.info("acceptorThread is end:{}", sb.toString());
                    JSONObject result = JSON.parseObject(sb.toString());
                    JSONObject result = null;
                    try {
                        result = JSON.parseObject(sb.toString());
                    }catch (Exception e) {
                        log.error("error body:{}", sb.toString());
                        e.printStackTrace();
                    }
                    if(result == null){
                        continue;
                    }
@@ -178,6 +184,19 @@
                continue;
            }
            NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getDeviceNo());
            if (shuttleThread == null) {
                // init
                NyShuttleThread thread = new NyShuttleThread(device, redisUtil);;
                new Thread(thread).start();
                SlaveConnection.put(SlaveType.Shuttle, device.getDeviceNo(), thread);
            }else {
                Socket socket = shuttleThread.getSocket();
                if(socket == null){
                    continue;
                }
            }
            log.info("{}:device is run,devices:{}", device.getDeviceNo(),JSON.toJSONString(fakeServerMap));
            Thread fakeThread = new Thread(() -> {
@@ -195,10 +214,9 @@
            fakeThread.start();
            fakeThreadMap.put(String.valueOf(SlaveType.Shuttle) + device.getDeviceNo(), fakeThread);
            // init
            ThreadHandler thread = new NyShuttleThread(device, redisUtil);;
            new Thread(thread).start();
            SlaveConnection.put(SlaveType.Shuttle, device.getDeviceNo(), thread);
            try {
                Thread.sleep(2000);
            }catch (Exception e){}
        }
    }