From a37eca3ea9ad0d895ec8bb5af8c0d0b90da3169e Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 10 十二月 2021 17:04:59 +0800
Subject: [PATCH] 2021-12-10 1.更新
---
HDLSDK/hdl-socket/src/main/java/com/hdl/sdk/socket/SocketBoot.java | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/HDLSDK/hdl-socket/src/main/java/com/hdl/sdk/socket/SocketBoot.java b/HDLSDK/hdl-socket/src/main/java/com/hdl/sdk/socket/SocketBoot.java
index a66c148..70e9962 100644
--- a/HDLSDK/hdl-socket/src/main/java/com/hdl/sdk/socket/SocketBoot.java
+++ b/HDLSDK/hdl-socket/src/main/java/com/hdl/sdk/socket/SocketBoot.java
@@ -5,6 +5,7 @@
import androidx.collection.ArrayMap;
+import com.hdl.sdk.common.utils.LogUtils;
import com.hdl.sdk.common.utils.ThreadToolUtils;
import com.hdl.sdk.socket.annotation.ConnectStatus;
import com.hdl.sdk.socket.client.IClient;
@@ -67,7 +68,7 @@
final int maxRetry = client.getOptions().getMaxRetry();
if (maxRetry == 0 && resendCount.get() > 0 ||
(maxRetry > 0 && maxRetry + 1 < resendCount.get())) {
- Log.d("====", "===閲嶈繛娆℃暟杈惧埌鏈�澶�==");
+ LogUtils.d("====", "===閲嶈繛娆℃暟杈惧埌鏈�澶�==");
return;
}
if (!client.isConnect()) {
@@ -82,7 +83,7 @@
try {
resendCount.set(resendCount.get() + 1);
Thread.sleep(300L);
- Log.d("====", "==閲嶈繛绗�" + resendCount + "娆�==");
+ LogUtils.d("====", "==閲嶈繛绗�" + resendCount + "娆�==");
} catch (Exception ignored) {
}
}
@@ -90,7 +91,7 @@
client.connect();
isRun.set(true);
if (client.isConnect()) {
- Log.d("====", "====杩炴帴鎴愬姛====");
+ LogUtils.d("====", "====杩炴帴鎴愬姛====");
startHeartbeat();
initSendThread();
@@ -103,7 +104,7 @@
}
} catch (Exception e) {
e.printStackTrace();
- Log.d("====", "===杩炴帴澶辫触===" + e);
+ LogUtils.d("====", "===杩炴帴澶辫触===" + e);
//鍐嶅垽鏂竴涓嬫湁娌℃湁杩炴帴
if (!client.isConnect()) {
isRun.set(false);
@@ -126,9 +127,12 @@
public void run() {
while (isRun.get()) {
if (client.isConnect()) {
- Log.d("=====", "==鍙戦�佹暟鎹�==");
+ LogUtils.d("=====", "==鍙戦�佹暟鎹�==");
+
try {
SocketRequest socketRequest = mMessageQueue.take();
+ final String sendStr = new String(socketRequest.getData(), 0, socketRequest.getData().length);
+ LogUtils.d("=====", "==鍙戦�佹暟鎹�==锛�"+sendStr);
final String action = socketRequest.getAction();
try {
client.sendMsg(socketRequest.getData());
@@ -162,7 +166,7 @@
}
}
- Log.d("=====", "==鍙戦�佺嚎绋嬪叧闂�==");
+ LogUtils.d("=====", "==鍙戦�佺嚎绋嬪叧闂�==");
}
});
@@ -182,7 +186,7 @@
client.onHandleResponse();
} catch (Exception e) {
e.printStackTrace();
- Log.d("====", "鏂紑杩炴帴" + e.getMessage());
+ LogUtils.d("====", "鏂紑杩炴帴" + e.getMessage());
disconnectError();
}
}
@@ -205,7 +209,7 @@
@Override
public void run() {
if (isRun.get()) {
- Log.d("====", "===鍙戦�佸績璺冲寘===");
+// LogUtils.d("====", "===鍙戦�佸績璺冲寘===");
if (client.getOptions() != null) {
final byte[] heartBeat = client.getOptions().getHeartbeatData();
if (heartBeat != null) {
--
Gitblit v1.8.0