mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-09-08 10:10:49 +00:00
Port
This commit is contained in:
@@ -3143,10 +3143,16 @@ public partial class EpConnection : NetworkConnection, IStore
|
||||
return new AsyncReply<bool>(true);
|
||||
|
||||
|
||||
var host = Instance.Name.Split(':');
|
||||
if (!Uri.TryCreate($"ep://{Instance.Name}", UriKind.Absolute, out var endpoint)
|
||||
|| string.IsNullOrWhiteSpace(endpoint.Host)
|
||||
|| endpoint.Port <= 0
|
||||
|| endpoint.Port > ushort.MaxValue)
|
||||
throw new FormatException(
|
||||
"EP endpoints must include an explicit port (for example, ep://host:port)."
|
||||
);
|
||||
|
||||
var address = host[0];
|
||||
var port = host.Length > 1 ? ushort.Parse(host[1]) : (ushort)10518;
|
||||
var address = endpoint.Host;
|
||||
var port = checked((ushort)endpoint.Port);
|
||||
|
||||
// assign domain from hostname if not provided
|
||||
if (context is EpConnectionContext epContext)
|
||||
|
||||
@@ -131,12 +131,14 @@ public class EpServer : NetworkServer<EpConnection>, IResource
|
||||
set;
|
||||
}
|
||||
|
||||
//[Attribute]
|
||||
/// <summary>
|
||||
/// Application-supplied native TCP port. Zero requests an ephemeral port from the OS.
|
||||
/// </summary>
|
||||
public ushort Port
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = 10518;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Controls whether warehouse initialization opens Esiur's native TCP listener.
|
||||
|
||||
Reference in New Issue
Block a user