From ce511a3d55e5f349b1647172e562c1659bbc8172 Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期五, 09 一月 2026 15:27:27 +0800
Subject: [PATCH] #

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

diff --git a/src/main/java/com/zy/core/thread/impl/NyShuttleThread.java b/src/main/java/com/zy/core/thread/impl/NyShuttleThread.java
index 9f54ac8..b04f6d2 100644
--- a/src/main/java/com/zy/core/thread/impl/NyShuttleThread.java
+++ b/src/main/java/com/zy/core/thread/impl/NyShuttleThread.java
@@ -64,6 +64,7 @@
                     );
                     Thread.sleep(200);
                 } catch (Exception e) {
+                    closeSocket();
                     e.printStackTrace();
                 }
             }
@@ -301,6 +302,8 @@
                 return false;
             }
 
+            this.lastConnectTime = System.currentTimeMillis();
+
             if(this.deviceConfig.getFake()) {
                 return fakeConnect();
             }else {
@@ -310,7 +313,6 @@
                     deviceSocket.setSoTimeout(10000);
                     deviceSocket.setKeepAlive(true);
                     this.socket = deviceSocket;
-                    this.lastConnectTime = System.currentTimeMillis();
                     log.info(MessageFormat.format("銆恵0}銆戝洓鍚戠┛姊溅Socket閾炬帴鎴愬姛 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), deviceConfig.getDeviceNo(), deviceConfig.getIp(), deviceConfig.getPort()));
                 }
             }

--
Gitblit v1.9.1