diff --git a/src/core/Akka.Remote.Tests/RemoteConfigSpec.cs b/src/core/Akka.Remote.Tests/RemoteConfigSpec.cs index 64ce815245d..3dabff87788 100644 --- a/src/core/Akka.Remote.Tests/RemoteConfigSpec.cs +++ b/src/core/Akka.Remote.Tests/RemoteConfigSpec.cs @@ -12,6 +12,7 @@ using Akka.TestKit; using Akka.Util.Internal; using Xunit; +using System.Net; namespace Akka.Remote.Tests { @@ -113,6 +114,17 @@ public void Remoting_should_contain_correct_socket_worker_pool_configuration_val Assert.Equal(2, pool.GetInt("pool-size-max")); } } - } + + [Fact] + public void Remoting_should_contain_correct_hostname_values_in_ReferenceConf() + { + var c = ((RemoteActorRefProvider)((ActorSystemImpl)Sys).Provider).RemoteSettings.Config.GetConfig("akka.remote.helios.tcp"); + var s = new HeliosTransportSettings(c); + + //Non-specified hostnames should default to IPAddress.Any + Assert.Equal(IPAddress.Any.ToString(), s.Hostname); + Assert.Equal(IPAddress.Any.ToString(), s.PublicHostname); + } + } } diff --git a/src/core/Akka.Remote/Transport/Helios/HeliosTransport.cs b/src/core/Akka.Remote/Transport/Helios/HeliosTransport.cs index cdb356b3f22..d66b40e8c56 100644 --- a/src/core/Akka.Remote/Transport/Helios/HeliosTransport.cs +++ b/src/core/Akka.Remote/Transport/Helios/HeliosTransport.cs @@ -84,6 +84,7 @@ private void Init() var publicConfigHost = Config.GetString("public-hostname"); Hostname = string.IsNullOrEmpty(configHost) ? IPAddress.Any.ToString() : configHost; PublicHostname = string.IsNullOrEmpty(publicConfigHost) ? configHost : publicConfigHost; + PublicHostname = string.IsNullOrEmpty(publicConfigHost) ? Hostname : publicConfigHost; ServerSocketWorkerPoolSize = ComputeWps(Config.GetConfig("server-socket-worker-pool")); ClientSocketWorkerPoolSize = ComputeWps(Config.GetConfig("client-socket-worker-pool")); Port = Config.GetInt("port");