diff --git a/src/libraries/System.Net.Quic/ref/System.Net.Quic.cs b/src/libraries/System.Net.Quic/ref/System.Net.Quic.cs index dcebe2b547ea3d..0241a3f0436978 100644 --- a/src/libraries/System.Net.Quic/ref/System.Net.Quic.cs +++ b/src/libraries/System.Net.Quic/ref/System.Net.Quic.cs @@ -140,13 +140,15 @@ namespace System.Net.Quic.Implementations.Managed { public sealed partial class ManagedQuicConnection : System.IAsyncDisposable { - public ManagedQuicConnection(System.Net.Quic.QuicClientConnectionOptions options) { } + internal ManagedQuicConnection() { } + public static bool IsSupported { get { throw null; } } public System.Net.IPEndPoint LocalEndPoint { get { throw null; } } public System.Net.Security.SslApplicationProtocol NegotiatedApplicationProtocol { get { throw null; } } public System.Security.Cryptography.X509Certificates.X509Certificate? RemoteCertificate { get { throw null; } } public System.Net.EndPoint RemoteEndPoint { get { throw null; } } public System.Threading.Tasks.ValueTask AcceptInboundStreamAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public System.Threading.Tasks.ValueTask CloseAsync(long errorCode, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.ValueTask ConnectAsync(System.Net.Quic.QuicClientConnectionOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public System.Threading.Tasks.ValueTask DisposeAsync() { throw null; } public System.Threading.Tasks.ValueTask OpenOutboundStreamAsync(System.Net.Quic.QuicStreamType type, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Managed/ManagedQuicConnection.cs b/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Managed/ManagedQuicConnection.cs index 3ebfa33f1bec9d..60dadcd2b403ea 100644 --- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Managed/ManagedQuicConnection.cs +++ b/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Managed/ManagedQuicConnection.cs @@ -14,7 +14,6 @@ using System.Net.Quic.Implementations.Managed.Internal.Streams; using System.Net.Quic.Implementations.Managed.Internal.Tracing; using System.Net.Quic.Implementations.Managed.Internal.Tls; -using System.Net.Quic.Implementations.Managed.Internal.Tls.OpenSsl; using System.Net.Security; using System.Threading; using System.Threading.Tasks; @@ -28,6 +27,14 @@ namespace System.Net.Quic.Implementations.Managed { public sealed partial class ManagedQuicConnection : IAsyncDisposable { + public static bool IsSupported => true; + public static async ValueTask ConnectAsync(QuicClientConnectionOptions options, CancellationToken cancellationToken = default) + { + var connection = new ManagedQuicConnection(options, TlsFactory.Default); + await connection.ConnectAsync(cancellationToken).ConfigureAwait(false); + return connection; + } + // This limit should ensure that if we can fit at least an ack frame into the packet, private const int RequiredAllowanceForSending = 2 * ConnectionId.MaximumLength + 40; @@ -229,10 +236,6 @@ internal void Ping() /// internal EndPoint UnsafeRemoteEndPoint => _remoteEndpoint; - public ManagedQuicConnection(QuicClientConnectionOptions options) : this(options, TlsFactory.Default) - { - } - // client constructor internal ManagedQuicConnection(QuicClientConnectionOptions options, TlsFactory tlsFactory) { diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Managed/ManagedQuicListener.cs b/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Managed/ManagedQuicListener.cs index 7b51c78f2ec519..339d1d1d26aa07 100644 --- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Managed/ManagedQuicListener.cs +++ b/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Managed/ManagedQuicListener.cs @@ -5,7 +5,6 @@ using System.Net.Quic.Implementations.Managed.Internal; using System.Net.Quic.Implementations.Managed.Internal.Sockets; using System.Net.Quic.Implementations.Managed.Internal.Tls; -using System.Net.Quic.Implementations.Managed.Internal.Tls.OpenSsl; using System.Threading; using System.Threading.Channels; using System.Threading.Tasks;