From c819d4d45ba43393b4a3df4f0e9731d50577e455 Mon Sep 17 00:00:00 2001 From: Redkale <22250530@qq.com> Date: Sun, 22 Oct 2017 10:13:24 +0800 Subject: [PATCH] =?UTF-8?q?WATCH=E5=8D=8F=E8=AE=AE=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E9=BB=98=E8=AE=A4host=E6=94=B9=E4=B8=BA127.0.0.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/org/redkale/boot/NodeServer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/redkale/boot/NodeServer.java b/src/org/redkale/boot/NodeServer.java index 7898dbd26..f448fbb37 100644 --- a/src/org/redkale/boot/NodeServer.java +++ b/src/org/redkale/boot/NodeServer.java @@ -108,7 +108,7 @@ public abstract class NodeServer { public void init(AnyValue config) throws Exception { this.serverConf = config == null ? AnyValue.create() : config; if (isSNCP()) { // SNCP协议 - String host = this.serverConf.getValue("host", "0.0.0.0").replace("0.0.0.0", ""); + String host = this.serverConf.getValue("host", isWATCH() ? "127.0.0.1" : "0.0.0.0").replace("0.0.0.0", ""); this.sncpAddress = new InetSocketAddress(host.isEmpty() ? application.localAddress.getHostAddress() : host, this.serverConf.getIntValue("port")); this.sncpGroup = application.transportFactory.findGroupName(this.sncpAddress); //单向SNCP服务不需要对等group