src/Orleans.Runtime/Hosting/EndpointOptionsExtensions.cs
/// <summary>
/// Configure endpoints for the silo.
/// </summary>
/// <param name="builder">The host builder to configure.</param>
/// <param name="advertisedIP">The IP address to be advertised in membership tables</param>
/// <param name="siloPort">The port this silo uses for silo-to-silo communication.</param>
/// <param name="gatewayPort">The port this silo uses for client-to-silo (gateway) communication. Specify 0 to disable gateway functionality.</param>
/// <param name="listenOnAnyHostAddress">Set to true to listen on all IP addresses of the host instead of just the advertiseIP.</param>
/// <returns></returns>
Configure endpoints for the silo.
Configure endpoints for the silo .
public static ISiloBuilder ConfigureEndpoints(
            this ISiloBuilder builder,
            IPAddress advertisedIP,
            int siloPort,
            int gatewayPort,
            bool listenOnAnyHostAddress = false)
        {
            builder.Configure<EndpointOptions>(options =>
            {
                options.AdvertisedIPAddress = advertisedIP;
                options.GatewayPort = gatewayPort;
                options.SiloPort = siloPort;
                if (listenOnAnyHostAddress)
                {
                    options.SiloListeningEndpoint = new IPEndPoint(IPAddress.Any, siloPort);
                    options.GatewayListeningEndpoint = new IPEndPoint(IPAddress.Any, gatewayPort);
                }
            });
            return builder;
        }
public static ISiloBuilder ConfigureEndpoints ( this ISiloBuilder builder , IPAddress advertisedIP , int siloPort , int gatewayPort , bool listenOnAnyHostAddress = false ) { builder . Configure < EndpointOptions > ( options => { options . AdvertisedIPAddress = advertisedIP ; options . GatewayPort = gatewayPort ; options . SiloPort = siloPort ; if ( listenOnAnyHostAddress ) { options . SiloListeningEndpoint = new IPEndPoint ( IPAddress . Any , siloPort ) ; options . GatewayListeningEndpoint = new IPEndPoint ( IPAddress . Any , gatewayPort ) ; } } ) ; return builder ; }
Configure endpoints for the silo.
Configure endpoints for the silo .
None
ISiloBuilder
this
advertisedIP
IPAddress
The IP address to be advertised in membership tables
The IP address to be advertised in membership tables
siloPort
int
The port this silo uses for silo-to-silo communication.
The port this silo uses for silo - to - silo communication .
gatewayPort
int
The port this silo uses for client-to-silo (gateway) communication. Specify 0 to disable gateway functionality.
The port this silo uses for client - to - silo ( gateway ) communication . Specify 0 to disable gateway functionality .
listenOnAnyHostAddress
bool
Set to true to listen on all IP addresses of the host instead of just the advertiseIP.
Set to true to listen on all IP addresses of the host instead of just the advertiseIP .
builder
The host builder to configure.
The host builder to configure .