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