From 545a4359905f23dcddc00ced4de46513146e8019 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期二, 18 三月 2025 09:34:30 +0800
Subject: [PATCH] #输出socket下发日志
---
src/main/java/com/zy/core/thread/impl/NyShuttleThread.java | 11 +++++++++--
1 files changed, 9 insertions(+), 2 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 d88c8fc..3c9d565 100644
--- a/src/main/java/com/zy/core/thread/impl/NyShuttleThread.java
+++ b/src/main/java/com/zy/core/thread/impl/NyShuttleThread.java
@@ -203,7 +203,7 @@
}
}
- public JSONObject getRequestBody(String type) {
+ public JSONObject getRequestBody(String type, String taskId) {
try {
// 鑾峰彇鏈嶅姟鍣ㄥ搷搴�
JSONObject result = null;
@@ -220,12 +220,17 @@
JSONObject resultResponse = JSON.parseObject(socketResult.get("response").toString());
JSONObject resultBody = JSON.parseObject(resultResponse.get("body").toString());
String responseType = resultBody.get("responseType").toString();
+ String responseTaskId = resultBody.get("taskId").toString();
if (DEBUG) {
result = socketResult;
break;
}
if (!responseType.equals(type)) {
+ continue;//鍝嶅簲绫诲瀷涓庤姹傜被鍨嬩笉涓�鑷达紝涓嶅湪璋冭瘯妯″紡涓�
+ }
+
+ if (!responseTaskId.equals(taskId)) {
continue;//鍝嶅簲ID涓庤姹侷D涓嶄竴鑷达紝涓嶅湪璋冭瘯妯″紡涓�
}
@@ -1079,8 +1084,10 @@
// System.out.println("Sent message to server: " + JSON.toJSONString(httpCommand));
String requestType = null;
+ String taskId = null;
try {
requestType = httpCommand.getRequest().getBody().get("requestType").toString();
+ taskId = httpCommand.getRequest().getBody().get("taskId").toString();
} catch (Exception e) {
return null;
}
@@ -1089,7 +1096,7 @@
// 灏濊瘯100娆�
JSONObject result = null;
for (int i = 0; i < 100; i++) {
- result = getRequestBody(requestType);
+ result = getRequestBody(requestType, taskId);
if (result == null) {
try {
Thread.sleep(100);
--
Gitblit v1.9.1