From 5b890a623a960e751d064ad57604afb7650234bc Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 11 Jan 2018 14:55:55 +0100 Subject: [PATCH] Fixed issue with config.host == null (it can never be null -- the "any" address is 0.0.0.0, and we take care of how to bind it to any internally) --- src/dorkbox/network/Server.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dorkbox/network/Server.java b/src/dorkbox/network/Server.java index e51a2710..a8cdae86 100644 --- a/src/dorkbox/network/Server.java +++ b/src/dorkbox/network/Server.java @@ -113,7 +113,11 @@ class Server extends EndPointServer { localChannelName = config.localChannelName; if (config.host == null) { + // we set this to "0.0.0.0" so that it is clear that we are trying to bind to that address. hostName = "0.0.0.0"; + + // make it clear that this is what we do (configuration wise) so that variable examination is consistent + config.host = hostName; } else { hostName = config.host; @@ -216,7 +220,7 @@ class Server extends EndPointServer { serializationManager)); // have to check options.host for null. we don't bind to 0.0.0.0, we bind to "null" to get the "any" address! - if (config.host != null) { + if (hostName.equals("0.0.0.0")) { tcpBootstrap.localAddress(hostName, tcpPort); } else {