From 8a3c59ed59ee5eb7227d66ce4b7c37f208bddc54 Mon Sep 17 00:00:00 2001 From: CaiHQ Date: Fri, 18 Jul 2025 19:59:27 +0800 Subject: [PATCH] update for async get endpoint info --- src/main/java/org/bdware/sc/server/DoipLocalSingleton.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bdware/sc/server/DoipLocalSingleton.java b/src/main/java/org/bdware/sc/server/DoipLocalSingleton.java index 073ba9e..aa77700 100644 --- a/src/main/java/org/bdware/sc/server/DoipLocalSingleton.java +++ b/src/main/java/org/bdware/sc/server/DoipLocalSingleton.java @@ -85,7 +85,8 @@ public class DoipLocalSingleton { EndpointInfo endpointInfo = null; for (int i = 0; i < 10; i++) { endpointInfo = irpClient.getEndpointInfo(); - if (endpointInfo == null) Thread.sleep(200); + if (endpointInfo == null) + Thread.sleep(200); } if (endpointInfo != null) { repoID = endpointInfo.getDoId(); @@ -99,7 +100,7 @@ public class DoipLocalSingleton { } // 如果启动参数中添加了 doipStartPort 参数,使用该参数作为启动端口 if (otherConfigs != null && otherConfigs.isJsonObject() - && otherConfigs.getAsJsonObject().has("doipStartPort") && infos.size() == 1) { + && otherConfigs.getAsJsonObject().has("doipStartPort") && infos.size() == 1) { int doipStartPort = otherConfigs.getAsJsonObject().get("doipStartPort").getAsInt(); // 如果当前启动的端口和指定的端口不一致,修改启动端口 if (doipStartPort != port) {