| | | 1 | | // Copyright (c) ZeroC, Inc. |
| | | 2 | | |
| | | 3 | | using IceRpc.Transports.Internal; |
| | | 4 | | using System.Net.Security; |
| | | 5 | | |
| | | 6 | | namespace IceRpc.Transports; |
| | | 7 | | |
| | | 8 | | /// <summary>A class to create outgoing multiplexed connections.</summary> |
| | | 9 | | public interface IMultiplexedClientTransport |
| | | 10 | | { |
| | | 11 | | /// <summary>Gets the default multiplexed client transport. It accepts transport names "quic" and "tcp"; a null |
| | | 12 | | /// transport name is equivalent to "quic".</summary> |
| | | 13 | | /// <value>The default multiplexed client transport.</value> |
| | 24 | 14 | | public static IMultiplexedClientTransport Default => DefaultMultiplexedClientTransport.Instance; |
| | | 15 | | |
| | | 16 | | /// <summary>Gets the default transport name.</summary> |
| | | 17 | | /// <value>The transport accepts transport addresses that use this name as the |
| | | 18 | | /// <see cref="TransportAddress.TransportName"/>. Some transports may accept additional names beyond this default. |
| | | 19 | | /// </value> |
| | | 20 | | string DefaultName { get; } |
| | | 21 | | |
| | | 22 | | /// <summary>Determines whether this transport requires SSL for the specified transport name.</summary> |
| | | 23 | | /// <param name="transportName">The transport name, or <see langword="null" /> which is equivalent to |
| | | 24 | | /// <see cref="DefaultName" />.</param> |
| | | 25 | | /// <returns><see langword="true" /> if SSL is required; otherwise, <see langword="false" />.</returns> |
| | | 26 | | /// <exception cref="NotSupportedException">Thrown if <paramref name="transportName" /> is not supported by this |
| | | 27 | | /// transport.</exception> |
| | | 28 | | bool IsSslRequired(string? transportName); |
| | | 29 | | |
| | | 30 | | /// <summary>Creates a new transport connection to the specified transport address.</summary> |
| | | 31 | | /// <param name="transportAddress">The transport address to connect to.</param> |
| | | 32 | | /// <param name="options">The multiplexed connection options.</param> |
| | | 33 | | /// <param name="clientAuthenticationOptions">The SSL client authentication options.</param> |
| | | 34 | | /// <returns>The new transport connection. This connection is not yet connected.</returns> |
| | | 35 | | /// <remarks>The IceRPC core can call this method concurrently so it must be thread-safe.</remarks> |
| | | 36 | | IMultiplexedConnection CreateConnection( |
| | | 37 | | TransportAddress transportAddress, |
| | | 38 | | MultiplexedConnectionOptions options, |
| | | 39 | | SslClientAuthenticationOptions? clientAuthenticationOptions); |
| | | 40 | | } |