Skip to content

Commit

Permalink
add missing constructor overloads (#44380)
Browse files Browse the repository at this point in the history
Co-authored-by: Geoffrey Kizer <[email protected]>
  • Loading branch information
geoffkizer and Geoffrey Kizer authored Nov 8, 2020
1 parent 628c14b commit 77f1def
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/libraries/System.Net.Quic/ref/System.Net.Quic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public static class QuicImplementationProviders
public sealed class QuicListener : IDisposable
{
public QuicListener(IPEndPoint listenEndPoint, System.Net.Security.SslServerAuthenticationOptions sslServerAuthenticationOptions) { throw null; }
public QuicListener(QuicListenerOptions options) { throw null; }
public QuicListener(Implementations.QuicImplementationProvider implementationProvider, IPEndPoint listenEndPoint, System.Net.Security.SslServerAuthenticationOptions sslServerAuthenticationOptions) { throw null; }
public QuicListener(Implementations.QuicImplementationProvider implementationProvider, QuicListenerOptions options) { throw null; }
public IPEndPoint ListenEndPoint => throw null;
Expand All @@ -37,6 +38,7 @@ public class QuicListenerOptions
public sealed class QuicConnection : IDisposable
{
public QuicConnection(System.Net.EndPoint remoteEndPoint, System.Net.Security.SslClientAuthenticationOptions? sslClientAuthenticationOptions, System.Net.IPEndPoint? localEndPoint = null) { throw null; }
public QuicConnection(QuicClientConnectionOptions options) { throw null; }
public QuicConnection(Implementations.QuicImplementationProvider implementationProvider, System.Net.EndPoint remoteEndPoint, System.Net.Security.SslClientAuthenticationOptions? sslClientAuthenticationOptions, System.Net.IPEndPoint? localEndPoint = null) { throw null; }
public QuicConnection(Implementations.QuicImplementationProvider implementationProvider, QuicClientConnectionOptions options) { throw null; }
public bool Connected => throw null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class QuicClientConnectionOptions
public long MaxUnidirectionalStreams { get; set; } = 100;

/// <summary>
/// Idle timeout for connections, afterwhich the connection will be closed.
/// Idle timeout for connections, after which the connection will be closed.
/// </summary>
public TimeSpan IdleTimeout { get; set; } = TimeSpan.FromMinutes(2);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,22 @@ public QuicConnection(EndPoint remoteEndPoint, SslClientAuthenticationOptions? s
{
}

// !!! TEMPORARY: Remove "implementationProvider" before shipping
/// <summary>
/// Create an outbound QUIC connection.
/// </summary>
/// <param name="options">The connection options.</param>
public QuicConnection(QuicClientConnectionOptions options)
: this(QuicImplementationProviders.Default, options)
{
}

// !!! TEMPORARY: Remove or make internal before shipping
public QuicConnection(QuicImplementationProvider implementationProvider, EndPoint remoteEndPoint, SslClientAuthenticationOptions? sslClientAuthenticationOptions, IPEndPoint? localEndPoint = null)
: this(implementationProvider, new QuicClientConnectionOptions() { RemoteEndPoint = remoteEndPoint, ClientAuthenticationOptions = sslClientAuthenticationOptions, LocalEndPoint = localEndPoint })
{
}

// !!! TEMPORARY: Remove or make internal before shipping
public QuicConnection(QuicImplementationProvider implementationProvider, QuicClientConnectionOptions options)
{
_provider = implementationProvider.CreateConnection(options);
Expand Down
14 changes: 12 additions & 2 deletions src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public sealed class QuicListener : IDisposable
private readonly QuicListenerProvider _provider;

/// <summary>
/// Create a QUIC listener on the specified local endpoint and start listening.
/// Create a QUIC listener.
/// </summary>
/// <param name="listenEndPoint">The local endpoint to listen on.</param>
/// <param name="sslServerAuthenticationOptions">TLS options for the listener.</param>
Expand All @@ -22,12 +22,22 @@ public QuicListener(IPEndPoint listenEndPoint, SslServerAuthenticationOptions ss
{
}

// !!! TEMPORARY: Remove "implementationProvider" before shipping
/// <summary>
/// Create a QUIC listener.
/// </summary>
/// <param name="options">The listener options.</param>
public QuicListener(QuicListenerOptions options)
: this(QuicImplementationProviders.Default, options)
{
}

// !!! TEMPORARY: Remove or make internal before shipping
public QuicListener(QuicImplementationProvider implementationProvider, IPEndPoint listenEndPoint, SslServerAuthenticationOptions sslServerAuthenticationOptions)
: this(implementationProvider, new QuicListenerOptions() { ListenEndPoint = listenEndPoint, ServerAuthenticationOptions = sslServerAuthenticationOptions })
{
}

// !!! TEMPORARY: Remove or make internal before shipping
public QuicListener(QuicImplementationProvider implementationProvider, QuicListenerOptions options)
{
_provider = implementationProvider.CreateListener(options);
Expand Down

0 comments on commit 77f1def

Please sign in to comment.