test(batch23): port and verify mapped route tests
This commit is contained in:
@@ -77,16 +77,30 @@ public sealed partial class NatsServer
|
||||
internal Exception? SetRouteInfoHostPortAndIP()
|
||||
{
|
||||
var opts = GetOpts();
|
||||
var host = opts.Cluster.Host;
|
||||
if (string.IsNullOrWhiteSpace(host))
|
||||
host = opts.Host;
|
||||
string host;
|
||||
int port;
|
||||
if (!string.IsNullOrWhiteSpace(opts.Cluster.Advertise))
|
||||
{
|
||||
var (advHost, advPort, advErr) = Internal.ServerUtilities.ParseHostPort(opts.Cluster.Advertise, opts.Cluster.Port);
|
||||
if (advErr != null)
|
||||
return new InvalidOperationException($"Cluster.Advertise invalid: {opts.Cluster.Advertise}", advErr);
|
||||
host = advHost;
|
||||
port = advPort;
|
||||
}
|
||||
else
|
||||
{
|
||||
host = opts.Cluster.Host;
|
||||
if (string.IsNullOrWhiteSpace(host))
|
||||
host = opts.Host;
|
||||
port = opts.Cluster.Port;
|
||||
}
|
||||
|
||||
_mu.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
_routeInfo.Host = host;
|
||||
_routeInfo.Port = opts.Cluster.Port;
|
||||
_routeInfo.Ip = $"nats-route://{host}:{opts.Cluster.Port}/";
|
||||
_routeInfo.Port = port;
|
||||
_routeInfo.Ip = $"nats-route://{host}:{port}/";
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
|
||||
Reference in New Issue
Block a user