From 4a349f04abb665c0e99930bc1ef1c54ef24614f7 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 04 九月 2023 08:43:41 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/thread/NyShuttleThread.java | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/NyShuttleThread.java b/src/main/java/com/zy/core/thread/NyShuttleThread.java
index 7ec573f..54e38f7 100644
--- a/src/main/java/com/zy/core/thread/NyShuttleThread.java
+++ b/src/main/java/com/zy/core/thread/NyShuttleThread.java
@@ -87,7 +87,7 @@
private void read() {
try {
- if (this.socket == null || !this.socket.isConnected()) {
+ if (this.socket == null || this.socket.isClosed()) {
//閾炬帴鏂紑閲嶆柊閾炬帴
this.connect();
}
@@ -117,7 +117,7 @@
NyShuttleHttpCommand readStatusCommand = NyHttpUtils.getReadStatusCommand(slave.getId());
JSONObject jsonObject = NyHttpUtils.requestCommand(socket, readStatusCommand);
if (jsonObject == null) {
- OutputQueue.SHUTTLE.offer(MessageFormat.format("銆恵0}銆戝洓鍚戠┛姊溅plc鐘舵�佷俊鎭け璐� ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));
+ OutputQueue.SHUTTLE.offer(MessageFormat.format("銆恵0}銆戝洓鍚戠┛姊溅Socket鐘舵�佷俊鎭け璐� ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));
}else {
//鎵嬪姩鐘舵��/鑷姩鐘舵��
shuttleProtocol.setWorkingMode(jsonObject.getInteger("workingMode"));
@@ -243,7 +243,7 @@
}
} catch (Exception e) {
e.printStackTrace();
- OutputQueue.SHUTTLE.offer(MessageFormat.format("銆恵0}銆戝洓鍚戠┛姊溅plc鐘舵�佷俊鎭け璐� ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));
+ 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