From 239a12c8f0c617bd2437add293ac87e63a71c48a Mon Sep 17 00:00:00 2001
From: 野心家 <1051256694@qq.com>
Date: 星期二, 28 二月 2023 15:09:10 +0800
Subject: [PATCH] phpswcs创建
---
src/main/java/com/zy/core/thread/ScaleThread.java | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/ScaleThread.java b/src/main/java/com/zy/core/thread/ScaleThread.java
index c5a2d4b..4fbde19 100644
--- a/src/main/java/com/zy/core/thread/ScaleThread.java
+++ b/src/main/java/com/zy/core/thread/ScaleThread.java
@@ -1,6 +1,7 @@
package com.zy.core.thread;
import com.core.common.Cools;
+import com.zy.common.utils.News;
import com.zy.core.Slave;
import com.zy.core.ThreadHandler;
import lombok.Data;
@@ -55,6 +56,8 @@
@Override
public boolean connect() {
+ String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
+
try {
close(); //1.涓诲姩閲婃斁杩炴帴 //2.鏌愪簺鏈嶅姟鍣ㄥ鎸囧畾ip鏈夐摼璺暟闄愬埗
socket = new Socket();
@@ -63,10 +66,10 @@
socket.connect(socketAddress, 1000); //鏌愪簺鏈嶅姟鍣╬ing寤惰繜楂樻椂瑕佸鍔�,鍚﹀垯浼氭姤閿檆onnect timeout
dataOutputStream = new DataOutputStream(socket.getOutputStream());
dataInputStream = new DataInputStream(socket.getInputStream());
-// log.info("鏉$爜鎵弿浠繛鎺ユ垚鍔� ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
+// News.info("鏉$爜鎵弿浠繛鎺ユ垚鍔� ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
} catch (Exception e) {
socket = null;
- log.error("鏉$爜鎵弿浠繛鎺ュけ璐ワ紒锛侊紒 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
+ News.error(methodName + ":鏉$爜鎵弿浠繛鎺ュけ璐ワ紒锛侊紒 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
return false;
}
return true;
@@ -89,7 +92,7 @@
}
socket = null;
} catch (IOException e) {
- log.error("SocketClient close Exception:" + e.getMessage());
+ News.error("SocketClient close Exception:" + e.getMessage());
}
}
--
Gitblit v1.9.1