Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add missing QUIC constructor overloads #44380

Merged
merged 1 commit into from
Nov 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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