Closed ManickaP closed 2 years ago
Tagging subscribers to this area: @dotnet/ncl See info in area-owners.md if you want to be subscribed.
Author: | ManickaP |
---|---|
Assignees: | - |
Labels: | `api-suggestion`, `area-System.Net.Quic` |
Milestone: | - |
QuicProvider
and instead have the factory methods on QuicListener
and QuicConnection
.
namespace System.Net.Quic;
public static class QuicProvider
{
public static bool IsSupported { get; }
public static ValueTask<QuicListener> CreateListenerAsync(QuicListenerOptions options, CancellationToken cancellationToken = default);
public static ValueTask<QuicConnection> CreateConnectionAsync(QuicClientConnectionOptions options, CancellationToken cancellationToken = default);
}
Background and motivation
API design for exposing static
QuicProvider
to the public. MsQuic, the underlying implementation for System.Net.Quic, doesn't support all platforms .NET does, e.g.: Win 11+. So we need a static way to check whether QUIC is supported or not.QuicProvider
class is based onQuicImplementationProvider
we had in 6.0.Apart from
IsSupported
, we're also putting methods for connection and listener creation here.API Proposal
API Usage
Alternative Designs
Not having
QuicProvider
at all. Then, movingIsSupported
to eitherQuicListener
,QuicConnection
orQuicStream
and providing staticCreateAsync
methods onQuicListener
andQuicConnection
.Risks
As I'll state with all QUIC APIs. We might consider making all of these PreviewFeature. Not to deter user from using it, but to give us flexibility to tune the API shape based on customer feedback. We don't have many users now and we're mostly making these APIs based on what Kestrel needs, our limited experience with System.Net.Quic and my meager experiments with other QUIC implementations.
cc: @JamesNK @Tratcher @wfurt @CarnaViire @rzikm