From c4a528c756ec5aa68d34b6acdbea78c8bdb4569a Mon Sep 17 00:00:00 2001 From: Geoff Kizer Date: Tue, 12 Nov 2019 13:52:38 -0800 Subject: [PATCH] add QuicConnection.NegotiatedApplicationProtocol stub (dotnet/corefx#42563) Commit migrated from https://github.com/dotnet/corefx/commit/e717081e0074a0933a24182917c4c45739b85268 --- src/libraries/System.Net.Quic/ref/System.Net.Quic.cs | 1 + .../src/System/Net/Quic/Implementations/Mock/MockConnection.cs | 2 ++ .../src/System/Net/Quic/Implementations/QuicConnectionProvider.cs | 2 ++ src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs | 2 ++ 4 files changed, 7 insertions(+) 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 8b55f7b..07454f6 100644 --- a/src/libraries/System.Net.Quic/ref/System.Net.Quic.cs +++ b/src/libraries/System.Net.Quic/ref/System.Net.Quic.cs @@ -19,6 +19,7 @@ namespace System.Net.Quic public QuicStream OpenUnidirectionalStream() => throw null; public QuicStream OpenBidirectionalStream() => throw null; public System.Threading.Tasks.ValueTask AcceptStreamAsync(System.Threading.CancellationToken cancellationToken = default) => throw null; + public System.Net.Security.SslApplicationProtocol NegotiatedApplicationProtocol => throw null; public void Close() => throw null; public void Dispose() => throw null; } diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockConnection.cs b/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockConnection.cs index f495336..a0c1ff4 100644 --- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockConnection.cs +++ b/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockConnection.cs @@ -62,6 +62,8 @@ namespace System.Net.Quic.Implementations.Mock internal override IPEndPoint RemoteEndPoint => new IPEndPoint(_remoteEndPoint.Address, _remoteEndPoint.Port); + internal override SslApplicationProtocol NegotiatedApplicationProtocol => throw new NotImplementedException(); + internal override async ValueTask ConnectAsync(CancellationToken cancellationToken = default) { CheckDisposed(); diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/QuicConnectionProvider.cs b/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/QuicConnectionProvider.cs index 7c0af3d..596841d 100644 --- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/QuicConnectionProvider.cs +++ b/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/QuicConnectionProvider.cs @@ -23,6 +23,8 @@ namespace System.Net.Quic.Implementations internal abstract ValueTask AcceptStreamAsync(CancellationToken cancellationToken = default); + internal abstract System.Net.Security.SslApplicationProtocol NegotiatedApplicationProtocol { get; } + internal abstract void Close(); public abstract void Dispose(); diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs b/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs index 4348696..99a9c47 100644 --- a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs +++ b/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs @@ -44,6 +44,8 @@ namespace System.Net.Quic public IPEndPoint RemoteEndPoint => _provider.RemoteEndPoint; + public SslApplicationProtocol NegotiatedApplicationProtocol => _provider.NegotiatedApplicationProtocol; + /// /// Connect to the remote endpoint. /// -- 2.7.4