WATCH协议服务器默认host改为127.0.0.1
This commit is contained in:
@@ -108,7 +108,7 @@ public abstract class NodeServer {
|
|||||||
public void init(AnyValue config) throws Exception {
|
public void init(AnyValue config) throws Exception {
|
||||||
this.serverConf = config == null ? AnyValue.create() : config;
|
this.serverConf = config == null ? AnyValue.create() : config;
|
||||||
if (isSNCP()) { // SNCP协议
|
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.sncpAddress = new InetSocketAddress(host.isEmpty() ? application.localAddress.getHostAddress() : host, this.serverConf.getIntValue("port"));
|
||||||
this.sncpGroup = application.transportFactory.findGroupName(this.sncpAddress);
|
this.sncpGroup = application.transportFactory.findGroupName(this.sncpAddress);
|
||||||
//单向SNCP服务不需要对等group
|
//单向SNCP服务不需要对等group
|
||||||
|
|||||||
Reference in New Issue
Block a user