Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PublicHostname defaults to IPAddress.Any when hostname is blank #1621

Merged
merged 1 commit into from
Jan 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/core/Akka.Remote.Tests/RemoteConfigSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Akka.TestKit;
using Akka.Util.Internal;
using Xunit;
using System.Net;

namespace Akka.Remote.Tests
{
Expand Down Expand Up @@ -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);
}
}
}

1 change: 1 addition & 0 deletions src/core/Akka.Remote/Transport/Helios/HeliosTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down