Skip to content

Latest commit

 

History

History

Akka.Remote.Hosting

Akka Remoting Akka.Hosting Extensions

WithRemoting() Method

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);

Parameters

  • hostname string

    Optional. 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 string

    Optional. 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

Example

using var host = new HostBuilder()
    .ConfigureServices((context, services) =>
    {
        services.AddAkka("remotingDemo", (builder, provider) =>
        {
            builder.WithRemoting("127.0.0.1", 4053);
        });
    }).Build();

await host.RunAsync();