| | 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> |
| 113 | 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> |
| 107 | 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> |
| 2549 | 27 | | public TransportConnectionInformation( |
| 2549 | 28 | | EndPoint localNetworkAddress, |
| 2549 | 29 | | EndPoint remoteNetworkAddress, |
| 2549 | 30 | | X509Certificate? remoteCertificate) |
| 2549 | 31 | | { |
| 2549 | 32 | | LocalNetworkAddress = localNetworkAddress; |
| 2549 | 33 | | RemoteNetworkAddress = remoteNetworkAddress; |
| 2549 | 34 | | RemoteCertificate = remoteCertificate; |
| 2549 | 35 | | } |
| | 36 | | } |