| | | 1 | | // Copyright (c) ZeroC, Inc. |
| | | 2 | | |
| | | 3 | | using System.Net; |
| | | 4 | | using System.Security.Cryptography.X509Certificates; |
| | | 5 | | |
| | | 6 | | namespace IceRpc.Transports; |
| | | 7 | | |
| | | 8 | | /// <summary>The transport connection information returned on connection establishment.</summary> |
| | | 9 | | public sealed record class TransportConnectionInformation |
| | | 10 | | { |
| | | 11 | | /// <summary>Gets the network address of the local end of the connection.</summary> |
| | | 12 | | /// <value>The local network address.</value> |
| | 115 | 13 | | public EndPoint LocalNetworkAddress { get; } |
| | | 14 | | |
| | | 15 | | /// <summary>Gets the network address of the remote end of the connection.</summary> |
| | | 16 | | /// <value>The remote network address.</value> |
| | 109 | 17 | | public EndPoint RemoteNetworkAddress { get; } |
| | | 18 | | |
| | | 19 | | /// <summary>Gets the certificate of the peer, if provided.</summary> |
| | | 20 | | /// <value>The certificate of the peer or <see langword="null" /> if the peer didn't provide one.</value> |
| | 6 | 21 | | public X509Certificate? RemoteCertificate { get; } |
| | | 22 | | |
| | | 23 | | /// <summary>Constructs a new instance of <see cref="TransportConnectionInformation" />.</summary> |
| | | 24 | | /// <param name="localNetworkAddress">The local network address.</param> |
| | | 25 | | /// <param name="remoteNetworkAddress">The remote network address.</param> |
| | | 26 | | /// <param name="remoteCertificate">The remote certificate.</param> |
| | 2546 | 27 | | public TransportConnectionInformation( |
| | 2546 | 28 | | EndPoint localNetworkAddress, |
| | 2546 | 29 | | EndPoint remoteNetworkAddress, |
| | 2546 | 30 | | X509Certificate? remoteCertificate) |
| | 2546 | 31 | | { |
| | 2546 | 32 | | LocalNetworkAddress = localNetworkAddress; |
| | 2546 | 33 | | RemoteNetworkAddress = remoteNetworkAddress; |
| | 2546 | 34 | | RemoteCertificate = remoteCertificate; |
| | 2546 | 35 | | } |
| | | 36 | | } |