From 90a9d8af37d4ba479ad586fc310cbb9d8f3f9210 Mon Sep 17 00:00:00 2001 From: CaiHQ Date: Mon, 23 May 2022 17:06:54 +0800 Subject: [PATCH] doc: docker deploy feat: support docker debug --- src/main/java/org/bdware/sc/ContractClient.java | 8 ++++++-- src/main/java/org/bdware/sc/ContractStatusRecorder.java | 7 ++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/bdware/sc/ContractClient.java b/src/main/java/org/bdware/sc/ContractClient.java index 75ffdbb..42ee4e8 100644 --- a/src/main/java/org/bdware/sc/ContractClient.java +++ b/src/main/java/org/bdware/sc/ContractClient.java @@ -67,10 +67,14 @@ public class ContractClient { isRunning = false; } + public ContractClient(int startPort) { + this("127.0.0.1", startPort); + } + // Once the reconnect is called, all cp in the same node will reconnect to // current ContractManager // We only consider the. - public ContractClient(int startPort) { + public ContractClient(String host, int startPort) { // LOGGER.info("ContractClient 构造器 : "); contractMeta = new ContractMeta(); outputTracer = new ContractPrinter(); @@ -82,7 +86,7 @@ public class ContractClient { port = startPort; // LOGGER.info("ContractClient----构造器----- 端口 " + startPort); - get = new SocketGet("127.0.0.1", startPort); + get = new SocketGet(host, startPort); // LOGGER.info("ContractClient----构造器----- position---2"); String cpCMI = get.syncGet("", "isContractProcess", ""); // CMI diff --git a/src/main/java/org/bdware/sc/ContractStatusRecorder.java b/src/main/java/org/bdware/sc/ContractStatusRecorder.java index 6b858db..537b50b 100644 --- a/src/main/java/org/bdware/sc/ContractStatusRecorder.java +++ b/src/main/java/org/bdware/sc/ContractStatusRecorder.java @@ -389,6 +389,11 @@ public class ContractStatusRecorder extends StatusRecorder { @Override public boolean visit(int i) { + return visit("127.0.0.1", i); + } + + @Override + public boolean visit(String host, int i) { if (i == ContractManager.cPort.getCMPort()) { return false; } @@ -396,7 +401,7 @@ public class ContractStatusRecorder extends StatusRecorder { return true; } try { - ContractClient client = new ContractClient(i); + ContractClient client = new ContractClient(host, i); // LOGGER.info("[CM重连] position-----1"); if (client.isRunning) { LOGGER.debug("CP listened to port " + i + " is running");