| | | 1 | | // Copyright (c) ZeroC, Inc. |
| | | 2 | | |
| | | 3 | | using System.Collections.Immutable; |
| | | 4 | | |
| | | 5 | | namespace IceRpc.Transports; |
| | | 6 | | |
| | | 7 | | /// <summary>Represents a transport address with the host and port to connect to or listen on.</summary> |
| | | 8 | | public readonly record struct TransportAddress |
| | | 9 | | { |
| | | 10 | | /// <summary>Gets or initializes the host.</summary> |
| | | 11 | | /// <value>The host name or IP address.</value> |
| | 2680 | 12 | | public required string Host { get; init; } |
| | | 13 | | |
| | | 14 | | /// <summary>Gets or initializes the port number.</summary> |
| | | 15 | | /// <value>The port number.</value> |
| | 2819 | 16 | | public ushort Port { get; init; } |
| | | 17 | | |
| | | 18 | | /// <summary>Gets or initializes the transport name.</summary> |
| | | 19 | | /// <value>The transport name (e.g., "tcp", "ssl", "quic"), or <see langword="null" /> if unspecified.</value> |
| | 2049 | 20 | | public string? TransportName { get; init; } |
| | | 21 | | |
| | | 22 | | /// <summary>Gets or initializes the transport-specific parameters.</summary> |
| | | 23 | | /// <value>The transport parameters. Defaults to an empty dictionary.</value> |
| | 2727 | 24 | | public ImmutableDictionary<string, string> Params { get; init; } = []; |
| | | 25 | | |
| | | 26 | | /// <summary>Constructs a transport address.</summary> |
| | | 27 | | public TransportAddress() |
| | 901 | 28 | | { |
| | 901 | 29 | | } |
| | | 30 | | } |