An extension method to add Akka.Remote support to the ActorSystem
.
public static AkkaConfigurationBuilder WithRemoting(
this AkkaConfigurationBuilder builder,
string hostname = null,
int? port = null,
string publicHostname = null,
int? publicPort = null);
-
hostname
stringOptional. The hostname to bind Akka.Remote upon.
Default:
IPAddress.Any
or "0.0.0.0" -
port
int?Optional. The port to bind Akka.Remote upon.
Default: 2552
-
publicHostname
stringOptional. If using hostname aliasing, this is the host we will advertise.
Default: Fallback to
hostname
-
publicPort
int?Optional. If using port aliasing, this is the port we will advertise.
Default: Fallback to
port
using var host = new HostBuilder()
.ConfigureServices((context, services) =>
{
services.AddAkka("remotingDemo", (builder, provider) =>
{
builder.WithRemoting("127.0.0.1", 4053);
});
}).Build();
await host.RunAsync();