update for async get endpoint info

This commit is contained in:
CaiHQ
2025-07-18 19:59:27 +08:00
parent 9ecbf54c2d
commit 8a3c59ed59

View File

@@ -85,7 +85,8 @@ public class DoipLocalSingleton {
EndpointInfo endpointInfo = null; EndpointInfo endpointInfo = null;
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
endpointInfo = irpClient.getEndpointInfo(); endpointInfo = irpClient.getEndpointInfo();
if (endpointInfo == null) Thread.sleep(200); if (endpointInfo == null)
Thread.sleep(200);
} }
if (endpointInfo != null) { if (endpointInfo != null) {
repoID = endpointInfo.getDoId(); repoID = endpointInfo.getDoId();
@@ -99,7 +100,7 @@ public class DoipLocalSingleton {
} }
// 如果启动参数中添加了 doipStartPort 参数,使用该参数作为启动端口 // 如果启动参数中添加了 doipStartPort 参数,使用该参数作为启动端口
if (otherConfigs != null && otherConfigs.isJsonObject() 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(); int doipStartPort = otherConfigs.getAsJsonObject().get("doipStartPort").getAsInt();
// 如果当前启动的端口和指定的端口不一致,修改启动端口 // 如果当前启动的端口和指定的端口不一致,修改启动端口
if (doipStartPort != port) { if (doipStartPort != port) {