From 83449fef571c247a2d73194b8063638349d0076a Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 20 十一月 2023 10:04:52 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/thread/NyShuttleThread.java |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/NyShuttleThread.java b/src/main/java/com/zy/core/thread/NyShuttleThread.java
index 6d381d2..9cf2709 100644
--- a/src/main/java/com/zy/core/thread/NyShuttleThread.java
+++ b/src/main/java/com/zy/core/thread/NyShuttleThread.java
@@ -113,12 +113,6 @@
 
     private void readStatus() {
         try {
-            if (null == shuttleProtocol) {
-                shuttleProtocol = new NyShuttleProtocol();
-                shuttleProtocol.setShuttleNo(slave.getId().shortValue());
-                shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.IDLE);
-            }
-
             //----------璇诲彇鍥涘悜绌挎杞︾姸鎬�-----------
             NyShuttleHttpCommand readStatusCommand = NyHttpUtils.getReadStatusCommand(slave.getId());
             JSONObject jsonObject = NyHttpUtils.requestCommand(socket, readStatusCommand);
@@ -247,6 +241,7 @@
                     OutputQueue.SHUTTLE.offer(MessageFormat.format("銆恵0}銆慬id:{1}] <<<<< 瀹炴椂鏁版嵁鏇存柊鎴愬姛",DateUtils.convert(new Date()), slave.getId()));
 //                    log.info(MessageFormat.format("銆恵0}銆慬id:{1}] <<<<< 瀹炴椂鏁版嵁鏇存柊鎴愬姛",DateUtils.convert(new Date()), slave.getId()));
                 }
+                log.debug(JSON.toJSONString(shuttleProtocol));
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -269,6 +264,11 @@
             socket.setSoTimeout(60000);
             socket.setKeepAlive(true);
             this.socket = socket;
+            if (null == shuttleProtocol) {
+                shuttleProtocol = new NyShuttleProtocol();
+                shuttleProtocol.setShuttleNo(slave.getId().shortValue());
+            }
+            shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.IDLE);
             log.info(MessageFormat.format("銆恵0}銆戝洓鍚戠┛姊溅Socket閾炬帴鎴愬姛 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));
         } catch (IOException e) {
             OutputQueue.SHUTTLE.offer(MessageFormat.format("銆恵0}銆戝洓鍚戠┛姊溅Socket閾炬帴澶辫触 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));

--
Gitblit v1.9.1