From a4246a571c78ac6c46e7bf7dbfc123b7148caed8 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期二, 16 十一月 2021 13:43:48 +0800 Subject: [PATCH] 2021-11-16 1.更新 --- HDLSDK/hdl-socket/src/main/java/com/hdl/sdk/socket/SocketBoot.java | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 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 8d206f5..ac8ec9e 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,12 +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); - Log.d("=====", "==鍙戦�佹暟鎹�==锛�"+sendStr); + LogUtils.d("=====", "==鍙戦�佹暟鎹�==锛�"+sendStr); final String action = socketRequest.getAction(); try { client.sendMsg(socketRequest.getData()); @@ -165,7 +166,7 @@ } } - Log.d("=====", "==鍙戦�佺嚎绋嬪叧闂�=="); + LogUtils.d("=====", "==鍙戦�佺嚎绋嬪叧闂�=="); } }); @@ -185,7 +186,7 @@ client.onHandleResponse(); } catch (Exception e) { e.printStackTrace(); - Log.d("====", "鏂紑杩炴帴" + e.getMessage()); + LogUtils.d("====", "鏂紑杩炴帴" + e.getMessage()); disconnectError(); } } @@ -208,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