Move System.Net.Quic to internal shared source (#32549) (#32610)
authorChris Ross <Tratcher@Outlook.com>
Thu, 20 Feb 2020 21:42:07 +0000 (13:42 -0800)
committerGitHub <noreply@github.com>
Thu, 20 Feb 2020 21:42:07 +0000 (13:42 -0800)
66 files changed:
src/libraries/Common/src/System/Net/Http/aspnetcore/NetEventSource.Common.cs [new file with mode: 0644]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockConnection.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockConnection.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockImplementationProvider.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockImplementationProvider.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockListener.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockListener.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockStream.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockStream.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/MsQuicAddressHelpers.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicAddressHelpers.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/MsQuicParameterHelpers.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicParameterHelpers.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/MsQuicSecurityConfig.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicSecurityConfig.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/MsQuicSession.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicSession.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/QuicExceptionHelpers.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/QuicExceptionHelpers.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/Internal/ResettableCompletionSource.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/ResettableCompletionSource.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/MsQuicConnection.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicConnection.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/MsQuicImplementationProvider.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicImplementationProvider.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/MsQuicListener.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicListener.cs with 98% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/MsQuic/MsQuicStream.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/QuicConnectionProvider.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/QuicConnectionProvider.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/QuicImplementationProvider.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/QuicImplementationProvider.cs with 90% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/QuicListenerProvider.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/QuicListenerProvider.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/QuicStreamProvider.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/QuicStreamProvider.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/Interop.MsQuic.cs [moved from src/libraries/System.Net.Quic/src/Interop/Interop.MsQuic.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/MsQuicEnums.cs [moved from src/libraries/System.Net.Quic/src/Interop/MsQuicEnums.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/MsQuicNativeMethods.cs [moved from src/libraries/System.Net.Quic/src/Interop/MsQuicNativeMethods.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/MsQuicStatusCodes.cs [new file with mode: 0644]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/MsQuicStatusHelper.cs [moved from src/libraries/System.Net.Quic/src/Interop/Linux/MsQuicStatusHelper.cs with 50% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/NetEventSource.Quic.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/NetEventSource.Quic.cs with 100% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicClientConnectionOptions.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/QuicClientConnectionOptions.cs with 97% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicConnection.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs with 98% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicConnectionAbortedException.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnectionAbortedException.cs with 90% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicException.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/QuicException.cs with 88% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicImplementationProviders.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/QuicImplementationProviders.cs with 91% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicListener.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListener.cs with 97% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicListenerOptions.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListenerOptions.cs with 98% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicOperationAbortedException.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/QuicOperationAbortedException.cs with 87% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicStream.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/QuicStream.cs with 99% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/QuicStreamAbortedException.cs [moved from src/libraries/System.Net.Quic/src/System/Net/Quic/QuicStreamAbortedException.cs with 90% similarity]
src/libraries/Common/src/System/Net/Http/aspnetcore/SR.Quic.cs [new file with mode: 0644]
src/libraries/Common/src/System/Net/Http/aspnetcore/SR.resx
src/libraries/Common/tests/Common.Tests.csproj
src/libraries/Common/tests/Resources/Strings.resx
src/libraries/Common/tests/System/Net/Http/Http3LoopbackConnection.cs
src/libraries/Common/tests/System/Net/Http/Http3LoopbackStream.cs
src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTestBase.cs
src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/System.Net.Http.WinHttpHandler.Functional.Tests.csproj
src/libraries/System.Net.Http/src/PInvokeAnalyzerExceptionList.analyzerdata [moved from src/libraries/System.Net.Quic/src/PInvokeAnalyzerExceptionList.analyzerdata with 100% similarity]
src/libraries/System.Net.Http/src/Resources/SR.resx [moved from src/libraries/System.Net.Quic/src/Resources/Strings.resx with 73% similarity]
src/libraries/System.Net.Http/src/Resources/Strings.resx
src/libraries/System.Net.Http/src/System.Net.Http.csproj
src/libraries/System.Net.Http/tests/FunctionalTests/MsQuicTestBase.cs [moved from src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTestBase.cs with 84% similarity]
src/libraries/System.Net.Http/tests/FunctionalTests/MsQuicTests.cs [moved from src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs with 100% similarity]
src/libraries/System.Net.Http/tests/FunctionalTests/QuicConnectionTests.cs [moved from src/libraries/System.Net.Quic/tests/FunctionalTests/QuicConnectionTests.cs with 100% similarity]
src/libraries/System.Net.Http/tests/FunctionalTests/QuicListenerTests.cs [moved from src/libraries/System.Net.Quic/tests/FunctionalTests/QuicListenerTests.cs with 100% similarity]
src/libraries/System.Net.Http/tests/FunctionalTests/QuicStreamTests.cs [moved from src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamTests.cs with 100% similarity]
src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj
src/libraries/System.Net.Quic/Directory.Build.props [deleted file]
src/libraries/System.Net.Quic/System.Net.Quic.sln [deleted file]
src/libraries/System.Net.Quic/ref/System.Net.Quic.Temporary.cs [deleted file]
src/libraries/System.Net.Quic/ref/System.Net.Quic.cs [deleted file]
src/libraries/System.Net.Quic/ref/System.Net.Quic.csproj [deleted file]
src/libraries/System.Net.Quic/src/Interop/Linux/MsQuicStatusCodes.cs [deleted file]
src/libraries/System.Net.Quic/src/Interop/OSX/MsQuicStatusCodes.cs [deleted file]
src/libraries/System.Net.Quic/src/Interop/OSX/MsQuicStatusHelper.cs [deleted file]
src/libraries/System.Net.Quic/src/Interop/Windows/MsQuicStatusCodes.cs [deleted file]
src/libraries/System.Net.Quic/src/Interop/Windows/MsQuicStatusHelper.cs [deleted file]
src/libraries/System.Net.Quic/src/System.Net.Quic.csproj [deleted file]
src/libraries/System.Net.Quic/tests/FunctionalTests/System.Net.Quic.Tests.csproj [deleted file]

diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/NetEventSource.Common.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/NetEventSource.Common.cs
new file mode 100644 (file)
index 0000000..46cd2ee
--- /dev/null
@@ -0,0 +1,738 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#if DEBUG
+// Uncomment to enable runtime checks to help validate that NetEventSource isn't being misused
+// in a way that will cause performance problems, e.g. unexpected boxing of value types.
+//#define DEBUG_NETEVENTSOURCE_MISUSE
+#endif
+
+#nullable enable
+using System.Collections;
+using System.Diagnostics;
+using System.Diagnostics.Tracing;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+#if NET46
+using System.Security;
+#endif
+
+#pragma warning disable CA1823 // not all IDs are used by all partial providers
+
+namespace System.Net
+{
+    // Implementation:
+    // This partial file is meant to be consumed into each System.Net.* assembly that needs to log.  Each such assembly also provides
+    // its own NetEventSource partial class that adds an appropriate [EventSource] attribute, giving it a unique name for that assembly.
+    // Those partials can then also add additional events if needed, starting numbering from the NextAvailableEventId defined by this partial.
+
+    // Usage:
+    // - Operations that may allocate (e.g. boxing a value type, using string interpolation, etc.) or that may have computations
+    //   at call sites should guard access like:
+    //       if (NetEventSource.IsEnabled) NetEventSource.Enter(this, refArg1, valueTypeArg2); // entering an instance method with a value type arg
+    //       if (NetEventSource.IsEnabled) NetEventSource.Info(null, $"Found certificate: {cert}"); // info logging with a formattable string
+    // - Operations that have zero allocations / measurable computations at call sites can use a simpler pattern, calling methods like:
+    //       NetEventSource.Enter(this);                   // entering an instance method
+    //       NetEventSource.Info(this, "literal string");  // arbitrary message with a literal string
+    //       NetEventSource.Enter(this, refArg1, regArg2); // entering an instance method with two reference type arguments
+    //       NetEventSource.Enter(null);                   // entering a static method
+    //       NetEventSource.Enter(null, refArg1);          // entering a static method with one reference type argument
+    //   Debug.Asserts inside the logging methods will help to flag some misuse if the DEBUG_NETEVENTSOURCE_MISUSE compilation constant is defined.
+    //   However, because it can be difficult by observation to understand all of the costs involved, guarding can be done everywhere.
+    // - NetEventSource.Fail calls typically do not need to be prefixed with an IsEnabled check, even if they allocate, as FailMessage
+    //   should only be used in cases similar to Debug.Fail, where they are not expected to happen in retail builds, and thus extra costs
+    //   don't matter.
+    // - Messages can be strings, formattable strings, or any other object.  Objects (including those used in formattable strings) have special
+    //   formatting applied, controlled by the Format method.  Partial specializations can also override this formatting by implementing a partial
+    //   method that takes an object and optionally provides a string representation of it, in case a particular library wants to customize further.
+
+    /// <summary>Provides logging facilities for System.Net libraries.</summary>
+#if NET46
+    [SecuritySafeCritical]
+#endif
+    internal sealed partial class NetEventSource : EventSource
+    {
+        /// <summary>The single event source instance to use for all logging.</summary>
+        public static readonly NetEventSource Log = new NetEventSource();
+
+        #region Metadata
+        public class Keywords
+        {
+            public const EventKeywords Default = (EventKeywords)0x0001;
+            public const EventKeywords Debug = (EventKeywords)0x0002;
+            public const EventKeywords EnterExit = (EventKeywords)0x0004;
+        }
+
+        private const string MissingMember = "(?)";
+        private const string NullInstance = "(null)";
+        private const string StaticMethodObject = "(static)";
+        private const string NoParameters = "";
+        private const int MaxDumpSize = 1024;
+
+        private const int EnterEventId = 1;
+        private const int ExitEventId = 2;
+        private const int AssociateEventId = 3;
+        private const int InfoEventId = 4;
+        private const int ErrorEventId = 5;
+        private const int CriticalFailureEventId = 6;
+        private const int DumpArrayEventId = 7;
+
+        // These events are implemented in NetEventSource.Security.cs.
+        // Define the ids here so that projects that include NetEventSource.Security.cs will not have conflicts.
+        private const int EnumerateSecurityPackagesId = 8;
+        private const int SspiPackageNotFoundId = 9;
+        private const int AcquireDefaultCredentialId = 10;
+        private const int AcquireCredentialsHandleId = 11;
+        private const int InitializeSecurityContextId = 12;
+        private const int SecurityContextInputBufferId = 13;
+        private const int SecurityContextInputBuffersId = 14;
+        private const int AcceptSecuritContextId = 15;
+        private const int OperationReturnedSomethingId = 16;
+
+        private const int NextAvailableEventId = 17; // Update this value whenever new events are added.  Derived types should base all events off of this to avoid conflicts.
+        #endregion
+
+        #region Events
+        #region Enter
+        /// <summary>Logs entrance to a method.</summary>
+        /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+        /// <param name="formattableString">A description of the entrance, including any arguments to the call.</param>
+        /// <param name="memberName">The calling member.</param>
+        [NonEvent]
+        public static void Enter(object? thisOrContextObject, FormattableString? formattableString = null, [CallerMemberName] string? memberName = null)
+        {
+            DebugValidateArg(thisOrContextObject);
+            DebugValidateArg(formattableString);
+            if (IsEnabled) Log.Enter(IdOf(thisOrContextObject), memberName, formattableString != null ? Format(formattableString) : NoParameters);
+        }
+
+        /// <summary>Logs entrance to a method.</summary>
+        /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+        /// <param name="arg0">The object to log.</param>
+        /// <param name="memberName">The calling member.</param>
+        [NonEvent]
+        public static void Enter(object? thisOrContextObject, object arg0, [CallerMemberName] string? memberName = null)
+        {
+            DebugValidateArg(thisOrContextObject);
+            DebugValidateArg(arg0);
+            if (IsEnabled) Log.Enter(IdOf(thisOrContextObject), memberName, $"({Format(arg0)})");
+        }
+
+        /// <summary>Logs entrance to a method.</summary>
+        /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+        /// <param name="arg0">The first object to log.</param>
+        /// <param name="arg1">The second object to log.</param>
+        /// <param name="memberName">The calling member.</param>
+        [NonEvent]
+        public static void Enter(object? thisOrContextObject, object arg0, object arg1, [CallerMemberName] string? memberName = null)
+        {
+            DebugValidateArg(thisOrContextObject);
+            DebugValidateArg(arg0);
+            DebugValidateArg(arg1);
+            if (IsEnabled) Log.Enter(IdOf(thisOrContextObject), memberName, $"({Format(arg0)}, {Format(arg1)})");
+        }
+
+        /// <summary>Logs entrance to a method.</summary>
+        /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+        /// <param name="arg0">The first object to log.</param>
+        /// <param name="arg1">The second object to log.</param>
+        /// <param name="arg2">The third object to log.</param>
+        /// <param name="memberName">The calling member.</param>
+        [NonEvent]
+        public static void Enter(object? thisOrContextObject, object arg0, object arg1, object arg2, [CallerMemberName] string? memberName = null)
+        {
+            DebugValidateArg(thisOrContextObject);
+            DebugValidateArg(arg0);
+            DebugValidateArg(arg1);
+            DebugValidateArg(arg2);
+            if (IsEnabled) Log.Enter(IdOf(thisOrContextObject), memberName, $"({Format(arg0)}, {Format(arg1)}, {Format(arg2)})");
+        }
+
+        [Event(EnterEventId, Level = EventLevel.Informational, Keywords = Keywords.EnterExit)]
+        private void Enter(string thisOrContextObject, string? memberName, string parameters) =>
+            WriteEvent(EnterEventId, thisOrContextObject, memberName ?? MissingMember, parameters);
+        #endregion
+
+        #region Exit
+        /// <summary>Logs exit from a method.</summary>
+        /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+        /// <param name="formattableString">A description of the exit operation, including any return values.</param>
+        /// <param name="memberName">The calling member.</param>
+        [NonEvent]
+        public static void Exit(object? thisOrContextObject, FormattableString? formattableString = null, [CallerMemberName] string? memberName = null)
+        {
+            DebugValidateArg(thisOrContextObject);
+            DebugValidateArg(formattableString);
+            if (IsEnabled) Log.Exit(IdOf(thisOrContextObject), memberName, formattableString != null ? Format(formattableString) : NoParameters);
+        }
+
+        /// <summary>Logs exit from a method.</summary>
+        /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+        /// <param name="arg0">A return value from the member.</param>
+        /// <param name="memberName">The calling member.</param>
+        [NonEvent]
+        public static void Exit(object? thisOrContextObject, object arg0, [CallerMemberName] string? memberName = null)
+        {
+            DebugValidateArg(thisOrContextObject);
+            DebugValidateArg(arg0);
+            if (IsEnabled) Log.Exit(IdOf(thisOrContextObject), memberName, Format(arg0).ToString());
+        }
+
+        /// <summary>Logs exit from a method.</summary>
+        /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+        /// <param name="arg0">A return value from the member.</param>
+        /// <param name="arg1">A second return value from the member.</param>
+        /// <param name="memberName">The calling member.</param>
+        [NonEvent]
+        public static void Exit(object? thisOrContextObject, object arg0, object arg1, [CallerMemberName] string? memberName = null)
+        {
+            DebugValidateArg(thisOrContextObject);
+            DebugValidateArg(arg0);
+            DebugValidateArg(arg1);
+            if (IsEnabled) Log.Exit(IdOf(thisOrContextObject), memberName, $"{Format(arg0)}, {Format(arg1)}");
+        }
+
+        [Event(ExitEventId, Level = EventLevel.Informational, Keywords = Keywords.EnterExit)]
+        private void Exit(string thisOrContextObject, string? memberName, string? result) =>
+            WriteEvent(ExitEventId, thisOrContextObject, memberName ?? MissingMember, result);
+        #endregion
+
+        #region Info
+        /// <summary>Logs an information message.</summary>
+        /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+        /// <param name="formattableString">The message to be logged.</param>
+        /// <param name="memberName">The calling member.</param>
+        [NonEvent]
+        public static void Info(object? thisOrContextObject, FormattableString? formattableString = null, [CallerMemberName] string? memberName = null)
+        {
+            DebugValidateArg(thisOrContextObject);
+            DebugValidateArg(formattableString);
+            if (IsEnabled) Log.Info(IdOf(thisOrContextObject), memberName, formattableString != null ? Format(formattableString) : NoParameters);
+        }
+
+        /// <summary>Logs an information message.</summary>
+        /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+        /// <param name="message">The message to be logged.</param>
+        /// <param name="memberName">The calling member.</param>
+        [NonEvent]
+        public static void Info(object? thisOrContextObject, object? message, [CallerMemberName] string? memberName = null)
+        {
+            DebugValidateArg(thisOrContextObject);
+            DebugValidateArg(message);
+            if (IsEnabled) Log.Info(IdOf(thisOrContextObject), memberName, Format(message).ToString());
+        }
+
+        [Event(InfoEventId, Level = EventLevel.Informational, Keywords = Keywords.Default)]
+        private void Info(string thisOrContextObject, string? memberName, string? message) =>
+            WriteEvent(InfoEventId, thisOrContextObject, memberName ?? MissingMember, message);
+        #endregion
+
+        #region Error
+        /// <summary>Logs an error message.</summary>
+        /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+        /// <param name="formattableString">The message to be logged.</param>
+        /// <param name="memberName">The calling member.</param>
+        [NonEvent]
+        public static void Error(object? thisOrContextObject, FormattableString formattableString, [CallerMemberName] string? memberName = null)
+        {
+            DebugValidateArg(thisOrContextObject);
+            DebugValidateArg(formattableString);
+            if (IsEnabled) Log.ErrorMessage(IdOf(thisOrContextObject), memberName, Format(formattableString));
+        }
+
+        /// <summary>Logs an error message.</summary>
+        /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+        /// <param name="message">The message to be logged.</param>
+        /// <param name="memberName">The calling member.</param>
+        [NonEvent]
+        public static void Error(object? thisOrContextObject, object message, [CallerMemberName] string? memberName = null)
+        {
+            DebugValidateArg(thisOrContextObject);
+            DebugValidateArg(message);
+            if (IsEnabled) Log.ErrorMessage(IdOf(thisOrContextObject), memberName, Format(message).ToString());
+        }
+
+        [Event(ErrorEventId, Level = EventLevel.Error, Keywords = Keywords.Default)]
+        private void ErrorMessage(string thisOrContextObject, string? memberName, string? message) =>
+            WriteEvent(ErrorEventId, thisOrContextObject, memberName ?? MissingMember, message);
+        #endregion
+
+        #region Fail
+        /// <summary>Logs a fatal error and raises an assert.</summary>
+        /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+        /// <param name="formattableString">The message to be logged.</param>
+        /// <param name="memberName">The calling member.</param>
+        [NonEvent]
+        public static void Fail(object? thisOrContextObject, FormattableString formattableString, [CallerMemberName] string? memberName = null)
+        {
+            // Don't call DebugValidateArg on args, as we expect Fail to be used in assert/failure situations
+            // that should never happen in production, and thus we don't care about extra costs.
+
+            if (IsEnabled) Log.CriticalFailure(IdOf(thisOrContextObject), memberName, Format(formattableString));
+            Debug.Fail(Format(formattableString), $"{IdOf(thisOrContextObject)}.{memberName}");
+        }
+
+        /// <summary>Logs a fatal error and raises an assert.</summary>
+        /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+        /// <param name="message">The message to be logged.</param>
+        /// <param name="memberName">The calling member.</param>
+        [NonEvent]
+        public static void Fail(object? thisOrContextObject, object message, [CallerMemberName] string? memberName = null)
+        {
+            // Don't call DebugValidateArg on args, as we expect Fail to be used in assert/failure situations
+            // that should never happen in production, and thus we don't care about extra costs.
+
+            if (IsEnabled) Log.CriticalFailure(IdOf(thisOrContextObject), memberName, Format(message).ToString());
+            Debug.Fail(Format(message).ToString(), $"{IdOf(thisOrContextObject)}.{memberName}");
+        }
+
+        [Event(CriticalFailureEventId, Level = EventLevel.Critical, Keywords = Keywords.Debug)]
+        private void CriticalFailure(string thisOrContextObject, string? memberName, string? message) =>
+            WriteEvent(CriticalFailureEventId, thisOrContextObject, memberName ?? MissingMember, message);
+        #endregion
+
+        #region DumpBuffer
+        /// <summary>Logs the contents of a buffer.</summary>
+        /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+        /// <param name="buffer">The buffer to be logged.</param>
+        /// <param name="memberName">The calling member.</param>
+        [NonEvent]
+        public static void DumpBuffer(object? thisOrContextObject, byte[] buffer, [CallerMemberName] string? memberName = null)
+        {
+            DumpBuffer(thisOrContextObject, buffer, 0, buffer.Length, memberName);
+        }
+
+        /// <summary>Logs the contents of a buffer.</summary>
+        /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+        /// <param name="buffer">The buffer to be logged.</param>
+        /// <param name="offset">The starting offset from which to log.</param>
+        /// <param name="count">The number of bytes to log.</param>
+        /// <param name="memberName">The calling member.</param>
+        [NonEvent]
+        public static void DumpBuffer(object? thisOrContextObject, byte[] buffer, int offset, int count, [CallerMemberName] string? memberName = null)
+        {
+            if (IsEnabled)
+            {
+                if (offset < 0 || offset > buffer.Length - count)
+                {
+                    Fail(thisOrContextObject, $"Invalid {nameof(DumpBuffer)} Args. Length={buffer.Length}, Offset={offset}, Count={count}", memberName);
+                    return;
+                }
+
+                count = Math.Min(count, MaxDumpSize);
+
+                byte[] slice = buffer;
+                if (offset != 0 || count != buffer.Length)
+                {
+                    slice = new byte[count];
+                    Buffer.BlockCopy(buffer, offset, slice, 0, count);
+                }
+
+                Log.DumpBuffer(IdOf(thisOrContextObject), memberName, slice);
+            }
+        }
+
+        /// <summary>Logs the contents of a buffer.</summary>
+        /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+        /// <param name="bufferPtr">The starting location of the buffer to be logged.</param>
+        /// <param name="count">The number of bytes to log.</param>
+        /// <param name="memberName">The calling member.</param>
+        [NonEvent]
+        public static unsafe void DumpBuffer(object? thisOrContextObject, IntPtr bufferPtr, int count, [CallerMemberName] string? memberName = null)
+        {
+            Debug.Assert(bufferPtr != IntPtr.Zero);
+            Debug.Assert(count >= 0);
+
+            if (IsEnabled)
+            {
+                var buffer = new byte[Math.Min(count, MaxDumpSize)];
+                fixed (byte* targetPtr = buffer)
+                {
+                    Buffer.MemoryCopy((byte*)bufferPtr, targetPtr, buffer.Length, buffer.Length);
+                }
+                Log.DumpBuffer(IdOf(thisOrContextObject), memberName, buffer);
+            }
+        }
+
+        [Event(DumpArrayEventId, Level = EventLevel.Verbose, Keywords = Keywords.Debug)]
+        private unsafe void DumpBuffer(string thisOrContextObject, string? memberName, byte[] buffer) =>
+            WriteEvent(DumpArrayEventId, thisOrContextObject, memberName ?? MissingMember, buffer);
+        #endregion
+
+        #region Associate
+        /// <summary>Logs a relationship between two objects.</summary>
+        /// <param name="first">The first object.</param>
+        /// <param name="second">The second object.</param>
+        /// <param name="memberName">The calling member.</param>
+        [NonEvent]
+        public static void Associate(object first, object second, [CallerMemberName] string? memberName = null)
+        {
+            DebugValidateArg(first);
+            DebugValidateArg(second);
+            if (IsEnabled) Log.Associate(IdOf(first), memberName, IdOf(first), IdOf(second));
+        }
+
+        /// <summary>Logs a relationship between two objects.</summary>
+        /// <param name="thisOrContextObject">`this`, or another object that serves to provide context for the operation.</param>
+        /// <param name="first">The first object.</param>
+        /// <param name="second">The second object.</param>
+        /// <param name="memberName">The calling member.</param>
+        [NonEvent]
+        public static void Associate(object? thisOrContextObject, object first, object second, [CallerMemberName] string? memberName = null)
+        {
+            DebugValidateArg(thisOrContextObject);
+            DebugValidateArg(first);
+            DebugValidateArg(second);
+            if (IsEnabled) Log.Associate(IdOf(thisOrContextObject), memberName, IdOf(first), IdOf(second));
+        }
+
+        [Event(AssociateEventId, Level = EventLevel.Informational, Keywords = Keywords.Default, Message = "[{2}]<-->[{3}]")]
+        private void Associate(string thisOrContextObject, string? memberName, string first, string second) =>
+            WriteEvent(AssociateEventId, thisOrContextObject, memberName ?? MissingMember, first, second);
+        #endregion
+        #endregion
+
+        #region Helpers
+        [Conditional("DEBUG_NETEVENTSOURCE_MISUSE")]
+        private static void DebugValidateArg(object? arg)
+        {
+            if (!IsEnabled)
+            {
+                Debug.Assert(!(arg is ValueType), $"Should not be passing value type {arg?.GetType()} to logging without IsEnabled check");
+                Debug.Assert(!(arg is FormattableString), $"Should not be formatting FormattableString \"{arg}\" if tracing isn't enabled");
+            }
+        }
+
+        [Conditional("DEBUG_NETEVENTSOURCE_MISUSE")]
+        private static void DebugValidateArg(FormattableString? arg)
+        {
+            Debug.Assert(IsEnabled || arg == null, $"Should not be formatting FormattableString \"{arg}\" if tracing isn't enabled");
+        }
+
+        public static new bool IsEnabled =>
+            Log.IsEnabled();
+
+        [NonEvent]
+        public static string IdOf(object? value) => value != null ? value.GetType().Name + "#" + GetHashCode(value) : NullInstance;
+
+        [NonEvent]
+        public static int GetHashCode(object value) => value?.GetHashCode() ?? 0;
+
+        [NonEvent]
+        public static object Format(object? value)
+        {
+            // If it's null, return a known string for null values
+            if (value == null)
+            {
+                return NullInstance;
+            }
+
+            // Give another partial implementation a chance to provide its own string representation
+            string? result = null;
+            AdditionalCustomizedToString(value, ref result);
+            if (result != null)
+            {
+                return result;
+            }
+
+            // Format arrays with their element type name and length
+            if (value is Array arr)
+            {
+                return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]";
+            }
+
+            // Format ICollections as the name and count
+            if (value is ICollection c)
+            {
+                return $"{c.GetType().Name}({c.Count})";
+            }
+
+            // Format SafeHandles as their type, hash code, and pointer value
+            if (value is SafeHandle handle)
+            {
+                return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})";
+            }
+
+            // Format IntPtrs as hex
+            if (value is IntPtr)
+            {
+                return $"0x{value:X}";
+            }
+
+            // If the string representation of the instance would just be its type name,
+            // use its id instead.
+            string? toString = value.ToString();
+            if (toString == null || toString == value.GetType().FullName)
+            {
+                return IdOf(value);
+            }
+
+            // Otherwise, return the original object so that the caller does default formatting.
+            return value;
+        }
+
+        [NonEvent]
+        private static string Format(FormattableString s)
+        {
+            switch (s.ArgumentCount)
+            {
+                case 0: return s.Format;
+                case 1: return string.Format(s.Format, Format(s.GetArgument(0)));
+                case 2: return string.Format(s.Format, Format(s.GetArgument(0)), Format(s.GetArgument(1)));
+                case 3: return string.Format(s.Format, Format(s.GetArgument(0)), Format(s.GetArgument(1)), Format(s.GetArgument(2)));
+                default:
+                    object?[] args = s.GetArguments();
+                    object[] formattedArgs = new object[args.Length];
+                    for (int i = 0; i < args.Length; i++)
+                    {
+                        formattedArgs[i] = Format(args[i]);
+                    }
+                    return string.Format(s.Format, formattedArgs);
+            }
+        }
+
+        static partial void AdditionalCustomizedToString<T>(T value, ref string? result);
+        #endregion
+
+        #region Custom WriteEvent overloads
+
+        [NonEvent]
+        private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, string? arg3, string? arg4)
+        {
+            if (IsEnabled())
+            {
+                if (arg1 == null) arg1 = "";
+                if (arg2 == null) arg2 = "";
+                if (arg3 == null) arg3 = "";
+                if (arg4 == null) arg4 = "";
+
+                fixed (char* string1Bytes = arg1)
+                fixed (char* string2Bytes = arg2)
+                fixed (char* string3Bytes = arg3)
+                fixed (char* string4Bytes = arg4)
+                {
+                    const int NumEventDatas = 4;
+                    var descrs = stackalloc EventData[NumEventDatas];
+
+                    descrs[0] = new EventData
+                    {
+                        DataPointer = (IntPtr)string1Bytes,
+                        Size = ((arg1.Length + 1) * 2)
+                    };
+                    descrs[1] = new EventData
+                    {
+                        DataPointer = (IntPtr)string2Bytes,
+                        Size = ((arg2.Length + 1) * 2)
+                    };
+                    descrs[2] = new EventData
+                    {
+                        DataPointer = (IntPtr)string3Bytes,
+                        Size = ((arg3.Length + 1) * 2)
+                    };
+                    descrs[3] = new EventData
+                    {
+                        DataPointer = (IntPtr)string4Bytes,
+                        Size = ((arg4.Length + 1) * 2)
+                    };
+
+                    WriteEventCore(eventId, NumEventDatas, descrs);
+                }
+            }
+        }
+
+        [NonEvent]
+        private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, byte[]? arg3)
+        {
+            if (IsEnabled())
+            {
+                if (arg1 == null) arg1 = "";
+                if (arg2 == null) arg2 = "";
+                if (arg3 == null) arg3 = Array.Empty<byte>();
+
+                fixed (char* arg1Ptr = arg1)
+                fixed (char* arg2Ptr = arg2)
+                fixed (byte* arg3Ptr = arg3)
+                {
+                    int bufferLength = arg3.Length;
+                    const int NumEventDatas = 4;
+                    var descrs = stackalloc EventData[NumEventDatas];
+
+                    descrs[0] = new EventData
+                    {
+                        DataPointer = (IntPtr)arg1Ptr,
+                        Size = (arg1.Length + 1) * sizeof(char)
+                    };
+                    descrs[1] = new EventData
+                    {
+                        DataPointer = (IntPtr)arg2Ptr,
+                        Size = (arg2.Length + 1) * sizeof(char)
+                    };
+                    descrs[2] = new EventData
+                    {
+                        DataPointer = (IntPtr)(&bufferLength),
+                        Size = 4
+                    };
+                    descrs[3] = new EventData
+                    {
+                        DataPointer = (IntPtr)arg3Ptr,
+                        Size = bufferLength
+                    };
+
+                    WriteEventCore(eventId, NumEventDatas, descrs);
+                }
+            }
+        }
+
+        [NonEvent]
+        private unsafe void WriteEvent(int eventId, string? arg1, int arg2, int arg3, int arg4)
+        {
+            if (IsEnabled())
+            {
+                if (arg1 == null) arg1 = "";
+
+                fixed (char* arg1Ptr = arg1)
+                {
+                    const int NumEventDatas = 4;
+                    var descrs = stackalloc EventData[NumEventDatas];
+
+                    descrs[0] = new EventData
+                    {
+                        DataPointer = (IntPtr)(arg1Ptr),
+                        Size = (arg1.Length + 1) * sizeof(char)
+                    };
+                    descrs[1] = new EventData
+                    {
+                        DataPointer = (IntPtr)(&arg2),
+                        Size = sizeof(int)
+                    };
+                    descrs[2] = new EventData
+                    {
+                        DataPointer = (IntPtr)(&arg3),
+                        Size = sizeof(int)
+                    };
+                    descrs[3] = new EventData
+                    {
+                        DataPointer = (IntPtr)(&arg4),
+                        Size = sizeof(int)
+                    };
+
+                    WriteEventCore(eventId, NumEventDatas, descrs);
+                }
+            }
+        }
+
+        [NonEvent]
+        private unsafe void WriteEvent(int eventId, string? arg1, int arg2, string? arg3)
+        {
+            if (IsEnabled())
+            {
+                if (arg1 == null) arg1 = "";
+                if (arg3 == null) arg3 = "";
+
+                fixed (char* arg1Ptr = arg1)
+                fixed (char* arg3Ptr = arg3)
+                {
+                    const int NumEventDatas = 3;
+                    var descrs = stackalloc EventData[NumEventDatas];
+
+                    descrs[0] = new EventData
+                    {
+                        DataPointer = (IntPtr)(arg1Ptr),
+                        Size = (arg1.Length + 1) * sizeof(char)
+                    };
+                    descrs[1] = new EventData
+                    {
+                        DataPointer = (IntPtr)(&arg2),
+                        Size = sizeof(int)
+                    };
+                    descrs[2] = new EventData
+                    {
+                        DataPointer = (IntPtr)(arg3Ptr),
+                        Size = (arg3.Length + 1) * sizeof(char)
+                    };
+
+                    WriteEventCore(eventId, NumEventDatas, descrs);
+                }
+            }
+        }
+
+        [NonEvent]
+        private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, int arg3)
+        {
+            if (IsEnabled())
+            {
+                if (arg1 == null) arg1 = "";
+                if (arg2 == null) arg2 = "";
+
+                fixed (char* arg1Ptr = arg1)
+                fixed (char* arg2Ptr = arg2)
+                {
+                    const int NumEventDatas = 3;
+                    var descrs = stackalloc EventData[NumEventDatas];
+
+                    descrs[0] = new EventData
+                    {
+                        DataPointer = (IntPtr)(arg1Ptr),
+                        Size = (arg1.Length + 1) * sizeof(char)
+                    };
+                    descrs[1] = new EventData
+                    {
+                        DataPointer = (IntPtr)(arg2Ptr),
+                        Size = (arg2.Length + 1) * sizeof(char)
+                    };
+                    descrs[2] = new EventData
+                    {
+                        DataPointer = (IntPtr)(&arg3),
+                        Size = sizeof(int)
+                    };
+
+                    WriteEventCore(eventId, NumEventDatas, descrs);
+                }
+            }
+        }
+
+        [NonEvent]
+        private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, string? arg3, int arg4)
+        {
+            if (IsEnabled())
+            {
+                if (arg1 == null) arg1 = "";
+                if (arg2 == null) arg2 = "";
+                if (arg3 == null) arg3 = "";
+
+                fixed (char* arg1Ptr = arg1)
+                fixed (char* arg2Ptr = arg2)
+                fixed (char* arg3Ptr = arg3)
+                {
+                    const int NumEventDatas = 4;
+                    var descrs = stackalloc EventData[NumEventDatas];
+
+                    descrs[0] = new EventData
+                    {
+                        DataPointer = (IntPtr)(arg1Ptr),
+                        Size = (arg1.Length + 1) * sizeof(char)
+                    };
+                    descrs[1] = new EventData
+                    {
+                        DataPointer = (IntPtr)(arg2Ptr),
+                        Size = (arg2.Length + 1) * sizeof(char)
+                    };
+                    descrs[2] = new EventData
+                    {
+                        DataPointer = (IntPtr)(arg3Ptr),
+                        Size = (arg3.Length + 1) * sizeof(char)
+                    };
+                    descrs[3] = new EventData
+                    {
+                        DataPointer = (IntPtr)(&arg4),
+                        Size = sizeof(int)
+                    };
+
+                    WriteEventCore(eventId, NumEventDatas, descrs);
+                }
+            }
+        }
+        #endregion
+    }
+}
@@ -170,9 +170,8 @@ namespace System.Net.Quic.Implementations.MsQuic
                         return MsQuicStatusCodes.InternalError;
                 }
             }
-            catch (Exception ex)
+            catch (Exception)
             {
-                Console.WriteLine(ex.Message);
                 return MsQuicStatusCodes.InternalError;
             }
         }
diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/MsQuicStatusCodes.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Interop/MsQuicStatusCodes.cs
new file mode 100644 (file)
index 0000000..72c3568
--- /dev/null
@@ -0,0 +1,121 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Runtime.InteropServices;
+
+namespace System.Net.Quic.Implementations.MsQuic.Internal
+{
+    internal static class MsQuicStatusCodes
+    {
+        internal static readonly uint Success = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? Windows.Success : Linux.Success;
+        internal static readonly uint Pending = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? Windows.Pending : Linux.Pending;
+        internal static readonly uint InternalError = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? Windows.InternalError : Linux.InternalError;
+
+        // TODO return better error messages here.
+        public static string GetError(uint status)
+        {
+            return RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
+                ? Windows.GetError(status) : Linux.GetError(status);
+        }
+
+        private static class Windows
+        {
+            internal const uint Success = 0;
+            internal const uint Pending = 0x703E5;
+            internal const uint Continue = 0x704DE;
+            internal const uint OutOfMemory = 0x8007000E;
+            internal const uint InvalidParameter = 0x80070057;
+            internal const uint InvalidState = 0x8007139F;
+            internal const uint NotSupported = 0x80004002;
+            internal const uint NotFound = 0x80070490;
+            internal const uint BufferTooSmall = 0x8007007A;
+            internal const uint HandshakeFailure = 0x80410000;
+            internal const uint Aborted = 0x80004004;
+            internal const uint AddressInUse = 0x80072740;
+            internal const uint ConnectionTimeout = 0x800704CF;
+            internal const uint ConnectionIdle = 0x800704D4;
+            internal const uint InternalError = 0x80004005;
+            internal const uint ServerBusy = 0x800704C9;
+            internal const uint ProtocolError = 0x800704CD;
+            internal const uint HostUnreachable = 0x800704D0;
+            internal const uint VerNegError = 0x80410001;
+
+            // TODO return better error messages here.
+            public static string GetError(uint status)
+            {
+                return status switch
+                {
+                    Success => "SUCCESS",
+                    Pending => "PENDING",
+                    Continue => "CONTINUE",
+                    OutOfMemory => "OUT_OF_MEMORY",
+                    InvalidParameter => "INVALID_PARAMETER",
+                    InvalidState => "INVALID_STATE",
+                    NotSupported => "NOT_SUPPORTED",
+                    NotFound => "NOT_FOUND",
+                    BufferTooSmall => "BUFFER_TOO_SMALL",
+                    HandshakeFailure => "HANDSHAKE_FAILURE",
+                    Aborted => "ABORTED",
+                    AddressInUse => "ADDRESS_IN_USE",
+                    ConnectionTimeout => "CONNECTION_TIMEOUT",
+                    ConnectionIdle => "CONNECTION_IDLE",
+                    InternalError => "INTERNAL_ERROR",
+                    ServerBusy => "SERVER_BUSY",
+                    ProtocolError => "PROTOCOL_ERROR",
+                    VerNegError => "VER_NEG_ERROR",
+                    _ => status.ToString()
+                };
+            }
+        }
+
+        private static class Linux
+        {
+            internal const uint Success = 0;
+            internal const uint Pending = unchecked((uint)-2);
+            internal const uint Continue = unchecked((uint)-1);
+            internal const uint OutOfMemory = 12;
+            internal const uint InvalidParameter = 22;
+            internal const uint InvalidState = 200000002;
+            internal const uint NotSupported = 95;
+            internal const uint NotFound = 2;
+            internal const uint BufferTooSmall = 75;
+            internal const uint HandshakeFailure = 200000009;
+            internal const uint Aborted = 200000008;
+            internal const uint AddressInUse = 98;
+            internal const uint ConnectionTimeout = 110;
+            internal const uint ConnectionIdle = 200000011;
+            internal const uint InternalError = 200000012;
+            internal const uint ServerBusy = 200000007;
+            internal const uint ProtocolError = 200000013;
+            internal const uint VerNegError = 200000014;
+
+            // TODO return better error messages here.
+            public static string GetError(uint status)
+            {
+                return status switch
+                {
+                    Success => "SUCCESS",
+                    Pending => "PENDING",
+                    Continue => "CONTINUE",
+                    OutOfMemory => "OUT_OF_MEMORY",
+                    InvalidParameter => "INVALID_PARAMETER",
+                    InvalidState => "INVALID_STATE",
+                    NotSupported => "NOT_SUPPORTED",
+                    NotFound => "NOT_FOUND",
+                    BufferTooSmall => "BUFFER_TOO_SMALL",
+                    HandshakeFailure => "HANDSHAKE_FAILURE",
+                    Aborted => "ABORTED",
+                    AddressInUse => "ADDRESS_IN_USE",
+                    ConnectionTimeout => "CONNECTION_TIMEOUT",
+                    ConnectionIdle => "CONNECTION_IDLE",
+                    InternalError => "INTERNAL_ERROR",
+                    ServerBusy => "SERVER_BUSY",
+                    ProtocolError => "PROTOCOL_ERROR",
+                    VerNegError => "VER_NEG_ERROR",
+                    _ => status.ToString()
+                };
+            }
+        }
+    }
+}
@@ -1,4 +1,4 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
@@ -10,7 +10,17 @@ namespace System.Net.Quic.Implementations.MsQuic.Internal
     {
         internal static bool SuccessfulStatusCode(uint status)
         {
-            return (int)status <= 0;
+            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+            {
+                return status < 0x80000000;
+            }
+
+            if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+            {
+                return (int)status <= 0;
+            }
+
+            return false;
         }
     }
 }
@@ -9,7 +9,7 @@ namespace System.Net.Quic
     /// <summary>
     /// Options to provide to the <see cref="QuicConnection"/> when connecting to a Listener.
     /// </summary>
-    public class QuicClientConnectionOptions
+    internal class QuicClientConnectionOptions
     {
         /// <summary>
         /// Client authentication options to use when establishing a <see cref="QuicConnection"/>.
@@ -10,7 +10,7 @@ using System.Threading.Tasks;
 
 namespace System.Net.Quic
 {
-    public sealed class QuicConnection : IDisposable
+    internal sealed class QuicConnection : IDisposable
     {
         private readonly QuicConnectionProvider _provider;
 
@@ -4,7 +4,7 @@
 
 namespace System.Net.Quic
 {
-    public class QuicConnectionAbortedException : QuicException
+    internal class QuicConnectionAbortedException : QuicException
     {
         internal QuicConnectionAbortedException(long errorCode)
             : this(SR.Format(SR.net_quic_connectionaborted, errorCode), errorCode)
@@ -4,7 +4,7 @@
 
 namespace System.Net.Quic
 {
-    public class QuicException : Exception
+    internal class QuicException : Exception
     {
         public QuicException(string message)
             : base (message)
@@ -4,7 +4,7 @@
 
 namespace System.Net.Quic
 {
-    public static class QuicImplementationProviders
+    internal static class QuicImplementationProviders
     {
         public static Implementations.QuicImplementationProvider Mock { get; } = new Implementations.Mock.MockImplementationProvider();
         public static Implementations.QuicImplementationProvider MsQuic { get; } = new Implementations.MsQuic.MsQuicImplementationProvider();
@@ -9,7 +9,7 @@ using System.Threading.Tasks;
 
 namespace System.Net.Quic
 {
-    public sealed class QuicListener : IDisposable
+    internal sealed class QuicListener : IDisposable
     {
         private readonly QuicListenerProvider _provider;
 
@@ -9,7 +9,7 @@ namespace System.Net.Quic
     /// <summary>
     /// Options to provide to the <see cref="QuicListener"/>.
     /// </summary>
-    public class QuicListenerOptions
+    internal class QuicListenerOptions
     {
         /// <summary>
         /// Server Ssl options to use for ALPN, SNI, etc.
@@ -4,7 +4,7 @@
 
 namespace System.Net.Quic
 {
-    public class QuicOperationAbortedException : QuicException
+    internal class QuicOperationAbortedException : QuicException
     {
         internal QuicOperationAbortedException()
             : base(SR.net_quic_operationaborted)
@@ -10,7 +10,7 @@ using System.Threading.Tasks;
 
 namespace System.Net.Quic
 {
-    public sealed class QuicStream : Stream
+    internal sealed class QuicStream : Stream
     {
         private readonly QuicStreamProvider _provider;
 
@@ -4,7 +4,7 @@
 
 namespace System.Net.Quic
 {
-    public class QuicStreamAbortedException : QuicException
+    internal class QuicStreamAbortedException : QuicException
     {
         internal QuicStreamAbortedException(long errorCode)
             : this(SR.Format(SR.net_quic_streamaborted, errorCode), errorCode)
diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/SR.Quic.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/SR.Quic.cs
new file mode 100644 (file)
index 0000000..6a756f9
--- /dev/null
@@ -0,0 +1,20 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+namespace System.Net.Quic
+{
+    internal static partial class SR
+    {
+        // The resource generator used in AspNetCore does not create this method. This file fills in that functional gap
+        // so we don't have to modify the shared source.
+        internal static string Format(string resourceFormat, params object[] args)
+        {
+            if (args != null)
+            {
+                return string.Format(resourceFormat, args);
+            }
+
+            return resourceFormat;
+        }
+    }
+}
index bcd721a..c6c8b9b 100644 (file)
   <data name="net_http_request_invalid_char_encoding" xml:space="preserve">
     <value>Request headers must contain only ASCII characters.</value>
   </data>
+  <data name="net_quic_connectionaborted" xml:space="preserve">
+    <value>Connection aborted by peer ({0}).</value>
+  </data>
+  <data name="net_quic_notsupported" xml:space="preserve">
+    <value>QUIC is not supported on this platform. See http://aka.ms/dotnetquic</value>
+  </data>
+  <data name="net_quic_operationaborted" xml:space="preserve">
+    <value>Operation aborted.</value>
+  </data>
+  <data name="net_quic_streamaborted" xml:space="preserve">
+    <value>Stream aborted by peer ({0}).</value>
+  </data>
 </root>
\ No newline at end of file
index 2d09401..85bcb69 100644 (file)
@@ -1,9 +1,9 @@
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <CoverageSupported>false</CoverageSupported>
     <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
-    <TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix</TargetFrameworks>
+    <TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX</TargetFrameworks>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="$(CommonTestPath)System\Collections\DictionaryExtensions.cs">
     <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\StatusCodes.cs">
       <Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\StatusCodes.cs</Link>
     </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicAddressHelpers.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicAddressHelpers.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicApi.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicApi.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicParameterHelpers.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicParameterHelpers.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSecurityConfig.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSecurityConfig.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSession.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSession.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\QuicExceptionHelpers.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\QuicExceptionHelpers.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\ResettableCompletionSource.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\ResettableCompletionSource.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicConnection.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicConnection.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicImplementationProvider.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicImplementationProvider.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicListener.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicListener.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicStream.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicStream.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicImplementationProvider.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicImplementationProvider.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicListenerProvider.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicListenerProvider.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicConnectionProvider.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicConnectionProvider.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicStreamProvider.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicStreamProvider.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockImplementationProvider.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockImplementationProvider.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockListener.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockListener.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockConnection.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockConnection.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockStream.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockStream.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\NetEventSource.Quic.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\NetEventSource.Quic.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicClientConnectionOptions.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicClientConnectionOptions.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicImplementationProviders.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicImplementationProviders.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicConnection.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicConnection.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicListener.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicListener.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicListenerOptions.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicListenerOptions.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicOperationAbortedException.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicOperationAbortedException.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicStream.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicStream.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicException.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicException.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicConnectionAbortedException.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicConnectionAbortedException.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicStreamAbortedException.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicStreamAbortedException.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\Interop.MsQuic.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\Interop.MsQuic.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicEnums.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicEnums.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicNativeMethods.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicNativeMethods.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusCodes.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusCodes.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusHelper.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusHelper.cs</Link>
+    </Compile>
     <Compile Include="$(CommonPath)System\Text\ReusableTextReader.cs">
       <Link>Common\System\Text\ReusableTextReader.cs</Link>
     </Compile>
     </Compile>
     <Compile Include="Tests\System\Net\VirtualNetworkTest.cs" />
     <Compile Include="Tests\System\Net\VirtualNetworkStreamTest.cs" />
+    <Compile Include="$(CommonPath)System\Net\Logging\NetEventSource.Common.cs">
+      <Link>Common\System\Net\Logging\NetEventSource.Common.cs</Link>
+    </Compile>
     <Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs">
       <Link>Common\System\Threading\Tasks\TaskToApm.cs</Link>
     </Compile>
       <Link>System\PasteArguments.Unix.cs</Link>
     </Compile>
   </ItemGroup>
+  <!-- Linux specific files -->
+  <ItemGroup Condition="'$(TargetsLinux)' == 'true' ">
+    <Compile Include="$(CommonPath)Interop\Linux\Interop.Libraries.cs">
+      <Link>Common\Interop\Linux\Interop.Libraries.cs</Link>
+    </Compile>
+  </ItemGroup>
+  <!-- OSX specific files -->
+  <ItemGroup Condition=" '$(TargetsOSX)' == 'true' ">
+    <Compile Include="$(CommonPath)Interop\OSX\Interop.Libraries.cs">
+      <Link>Common\Interop\OSX\Interop.Libraries.cs</Link>
+    </Compile>
+  </ItemGroup>
   <ItemGroup>
     <Folder Include="CommonTest\System\" />
     <Folder Include="Common\System\Security\Cryptography\" />
index 0b40605..06f6019 100644 (file)
   <data name="net_http_request_invalid_char_encoding" xml:space="preserve">
     <value>Request headers must contain only ASCII characters.</value>
   </data>
+  <data name="net_quic_connectionaborted" xml:space="preserve">
+    <value>Connection aborted by peer ({0}).</value>
+  </data>
+  <data name="net_quic_notsupported" xml:space="preserve">
+    <value>QUIC is not supported on this platform. See http://aka.ms/dotnetquic</value>
+  </data>
+  <data name="net_quic_operationaborted" xml:space="preserve">
+    <value>Operation aborted.</value>
+  </data>
+  <data name="net_quic_streamaborted" xml:space="preserve">
+    <value>Stream aborted by peer ({0}).</value>
+  </data>
 </root>
\ No newline at end of file
index ac2e434..ca8b78d 100644 (file)
@@ -12,7 +12,7 @@ using System.Linq;
 
 namespace System.Net.Test.Common
 {
-    public sealed class Http3LoopbackConnection : GenericLoopbackConnection
+    internal sealed class Http3LoopbackConnection : GenericLoopbackConnection
     {
         public const long H3_NO_ERROR = 0x100;
         public const long H3_GENERAL_PROTOCOL_ERROR = 0x101;
index ad6ded1..e9cc448 100644 (file)
@@ -13,7 +13,7 @@ using System.Threading.Tasks;
 namespace System.Net.Test.Common
 {
 
-    public sealed class Http3LoopbackStream : IDisposable
+    internal sealed class Http3LoopbackStream : IDisposable
     {
         private const int MaximumVarIntBytes = 8;
         private const long VarIntMax = (1L << 62) - 1;
index 49b2076..8330874 100644 (file)
@@ -52,7 +52,9 @@ namespace System.Net.Http.Functional.Tests
             return useVersion.Major switch
             {
 #if NETCOREAPP
+#if HTTP3
                 3 => Http3LoopbackServerFactory.Singleton,
+#endif
                 2 => Http2LoopbackServerFactory.Singleton,
 #endif
                 _ => Http11LoopbackServerFactory.Singleton
index e31bec6..82e2835 100644 (file)
     <Compile Include="$(CommonTestPath)System\Net\Http\QPackTestEncoder.cs">
       <Link>Common\System\Net\Http\QPackTestEncoder.cs</Link>
     </Compile>
-    <Compile Include="$(CommonTestPath)System\Net\Http\Http3LoopbackServer.cs">
-      <Link>Common\System\Net\Http\Http3LoopbackServer.cs</Link>
-    </Compile>
-    <Compile Include="$(CommonTestPath)System\Net\Http\Http3LoopbackConnection.cs">
-      <Link>Common\System\Net\Http\Http3LoopbackConnection.cs</Link>
-    </Compile>
-    <Compile Include="$(CommonTestPath)System\Net\Http\Http3LoopbackStream.cs">
-      <Link>Common\System\Net\Http\Http3LoopbackStream.cs</Link>
-    </Compile>
     <Compile Include="$(CommonTestPath)System\Net\Http\HuffmanDecoder.cs">
       <Link>Common\System\Net\Http\HuffmanDecoder.cs</Link>
     </Compile>
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <root>
   <!-- 
     Microsoft ResX Schema 
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <data name="net_quic_connectionaborted" xml:space="preserve">
-    <value>Connection aborted by peer ({0}).</value>
+  <data name="net_http_headers_exceeded_length" xml:space="preserve">
+    <value>The HTTP headers length exceeded the set limit of {0} bytes.</value>
   </data>
-  <data name="net_quic_notsupported" xml:space="preserve">
-    <value>QUIC is not supported on this platform. See http://aka.ms/dotnetquic</value>
+  <data name="net_http_headers_invalid_header_name" xml:space="preserve">
+    <value>The header name format is invalid.</value>
   </data>
-  <data name="net_quic_operationaborted" xml:space="preserve">
-    <value>Operation aborted.</value>
+  <data name="net_http_hpack_bad_integer" xml:space="preserve">
+    <value>HPACK integer exceeds limits or has an overlong encoding.</value>
   </data>
-  <data name="net_quic_streamaborted" xml:space="preserve">
-    <value>Stream aborted by peer ({0}).</value>
+  <data name="net_http_hpack_encode_failure" xml:space="preserve">
+    <value>Failed to HPACK encode the headers.</value>
+  </data>
+  <data name="net_http_hpack_huffman_decode_failed" xml:space="preserve">
+    <value>Huffman-coded literal string failed to decode.</value>
+  </data>
+  <data name="net_http_hpack_incomplete_header_block" xml:space="preserve">
+    <value>Incomplete header block received.</value>
+  </data>
+  <data name="net_http_hpack_invalid_index" xml:space="preserve">
+    <value>Invalid header index: {0} is outside of static table and no dynamic table entry found.</value>
+  </data>
+  <data name="net_http_hpack_large_table_size_update" xml:space="preserve">
+    <value>A dynamic table size update of {0} octets is greater than the configured maximum size of {1} octets.</value>
+  </data>
+  <data name="net_http_hpack_late_dynamic_table_size_update" xml:space="preserve">
+    <value>Dynamic table size update received after beginning of header block.</value>
+  </data>
+  <data name="net_http_hpack_unexpected_end" xml:space="preserve">
+    <value>End of headers reached with incomplete token.</value>
+  </data>
+  <data name="net_http_invalid_header_name" xml:space="preserve">
+    <value>Received an invalid header name: '{0}'.</value>
+  </data>
+  <data name="net_http_qpack_no_dynamic_table" xml:space="preserve">
+    <value>No dynamic table support</value>
+  </data>
+  <data name="net_http_request_invalid_char_encoding" xml:space="preserve">
+    <value>Request headers must contain only ASCII characters.</value>
   </data>
 </root>
\ No newline at end of file
index c4e6717..4074b8e 100644 (file)
   <data name="net_http_request_timedout" xml:space="preserve">
     <value>The request was canceled due to the configured HttpClient.Timeout of {0} seconds elapsing.</value>
   </data>
+  <data name="net_quic_connectionaborted" xml:space="preserve">
+    <value>Connection aborted by peer ({0}).</value>
+  </data>
+  <data name="net_quic_notsupported" xml:space="preserve">
+    <value>QUIC is not supported on this platform. See http://aka.ms/dotnetquic</value>
+  </data>
+  <data name="net_quic_operationaborted" xml:space="preserve">
+    <value>Operation aborted.</value>
+  </data>
+  <data name="net_quic_streamaborted" xml:space="preserve">
+    <value>Stream aborted by peer ({0}).</value>
+  </data>
 </root>
\ No newline at end of file
index cbcd8ca..3cd8695 100644 (file)
@@ -1,4 +1,4 @@
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>Library</OutputType>
     <AssemblyName>System.Net.Http</AssemblyName>
@@ -7,7 +7,7 @@
     <NoWarn>$(NoWarn);0436;CS1573</NoWarn>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <DefineConstants>$(DefineConstants);HTTP_DLL</DefineConstants>
-    <TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-OSX</TargetFrameworks>
+    <TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX</TargetFrameworks>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(TargetsOSX)' == 'true' ">
     <DefineConstants>$(DefineConstants);SYSNETHTTP_NO_OPENSSL</DefineConstants>
     <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\QPack\H3StaticTable.cs">
       <Link>Common\System\Net\Http\aspnetcore\Http3\QPack\H3StaticTable.cs</Link>
     </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicAddressHelpers.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicAddressHelpers.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicApi.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicApi.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicParameterHelpers.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicParameterHelpers.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSecurityConfig.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSecurityConfig.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSession.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSession.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\QuicExceptionHelpers.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\QuicExceptionHelpers.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\ResettableCompletionSource.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\ResettableCompletionSource.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicConnection.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicConnection.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicImplementationProvider.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicImplementationProvider.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicListener.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicListener.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicStream.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicStream.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicImplementationProvider.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicImplementationProvider.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicListenerProvider.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicListenerProvider.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicConnectionProvider.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicConnectionProvider.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicStreamProvider.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicStreamProvider.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockImplementationProvider.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockImplementationProvider.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockListener.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockListener.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockConnection.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockConnection.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockStream.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockStream.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusCodes.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusCodes.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusHelper.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusHelper.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicClientConnectionOptions.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicClientConnectionOptions.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicImplementationProviders.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicImplementationProviders.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicConnection.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicConnection.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicListener.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicListener.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicListenerOptions.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicListenerOptions.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicOperationAbortedException.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicOperationAbortedException.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicStream.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicStream.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicException.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicException.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicConnectionAbortedException.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicConnectionAbortedException.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicStreamAbortedException.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicStreamAbortedException.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\Interop.MsQuic.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\Interop.MsQuic.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicEnums.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicEnums.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicNativeMethods.cs">
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicNativeMethods.cs</Link>
+    </Compile>
     <Compile Include="$(CommonPath)System\Net\SecurityStatusPal.cs">
       <Link>Common\System\Net\SecurityStatusPal.cs</Link>
     </Compile>
       <Link>Common\System\Text\ValueStringBuilder.cs</Link>
     </Compile>
   </ItemGroup>
+  <!-- Linux specific files -->
+  <ItemGroup Condition="'$(TargetsLinux)' == 'true' ">
+    <Compile Include="$(CommonPath)Interop\Linux\Interop.Libraries.cs">
+      <Link>Common\Interop\Linux\Interop.Libraries.cs</Link>
+    </Compile>
+  </ItemGroup>
   <!-- SocketsHttpHandler platform parts -->
   <ItemGroup Condition=" '$(TargetsUnix)' == 'true'">
     <Compile Include="System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.cs" />
     <Reference Include="System.Net.Primitives" />
     <Reference Include="System.Net.Security" />
     <Reference Include="System.Net.Sockets" />
-    <Reference Include="System.Net.Quic" />
     <Reference Include="System.Runtime" />
     <Reference Include="System.Runtime.Extensions" />
     <Reference Include="System.Runtime.InteropServices" />
+    <Reference Include="System.Runtime.InteropServices.RuntimeInformation" />
     <Reference Include="System.Security.Claims" Condition="'$(TargetsWindows)' == 'true'" />
     <Reference Include="System.Security.Cryptography.Algorithms" />
     <Reference Include="System.Security.Cryptography.Csp" />
     <Reference Include="System.Security.Principal" Condition="'$(TargetsWindows)' == 'true'" />
     <Reference Include="System.Security.Principal.Windows" />
     <Reference Include="System.Threading" />
+    <Reference Include="System.Threading.Channels" />
     <Reference Include="System.IO.Compression.Brotli" />
   </ItemGroup>
   <ItemGroup Condition="'$(TargetsUnix)' == 'true'">
     <Reference Include="System.Security.Cryptography.OpenSsl" />
     <Reference Include="System.Security.Cryptography.Primitives" />
   </ItemGroup>
+  <ItemGroup>
+    <Content Include="msquic.dll" Condition="Exists('msquic.dll')">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+      <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
+    </Content>
+    <Content Include="libmsquic.so" Condition="Exists('libmsquic.so')">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+      <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
+    </Content>
+    <Content Include="msquic.pdb" Condition="Exists('msquic.pdb')">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+      <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
+    </Content>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Resources\SR.resx" />
+  </ItemGroup>
 </Project>
@@ -22,24 +22,24 @@ namespace System.Net.Quic.Tests
             };
         }
 
-        public QuicConnection CreateQuicConnection(IPEndPoint endpoint)
+        internal QuicConnection CreateQuicConnection(IPEndPoint endpoint)
         {
             return new QuicConnection(QuicImplementationProviders.MsQuic, endpoint, GetSslClientAuthenticationOptions());
         }
 
-        public QuicListener CreateQuicListener()
+        internal QuicListener CreateQuicListener()
         {
             return CreateQuicListener(new IPEndPoint(IPAddress.Loopback, 0));
         }
 
-        public QuicListener CreateQuicListener(IPEndPoint endpoint)
+        internal QuicListener CreateQuicListener(IPEndPoint endpoint)
         {
             QuicListener listener = new QuicListener(QuicImplementationProviders.MsQuic, endpoint, GetSslServerAuthenticationOptions());
             listener.Start();
             return listener;
         }
 
-        public async Task RunClientServer(Func<QuicConnection, Task> clientFunction, Func<QuicConnection, Task> serverFunction, int millisecondsTimeout = 10_000)
+        internal async Task RunClientServer(Func<QuicConnection, Task> clientFunction, Func<QuicConnection, Task> serverFunction, int millisecondsTimeout = 10_000)
         {
             using QuicListener listener = CreateQuicListener();
 
index 8cb7a61..6aa7ae5 100644 (file)
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
+    <StringResourcesPath>../../src/Resources/Strings.resx</StringResourcesPath>
     <DefineConstants Condition="'$(TargetsWindows)'=='true'">$(DefineConstants);TargetsWindows</DefineConstants>
-    <DefineConstants>$(DefineConstants);SYSNETHTTP_NO_OPENSSL</DefineConstants>
+    <DefineConstants>$(DefineConstants);SYSNETHTTP_NO_OPENSSL;HTTP3</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <IncludeRemoteExecutor>true</IncludeRemoteExecutor>
-    <TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix</TargetFrameworks>
+    <TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX</TargetFrameworks>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs" Condition="'$(TargetsUnix)' == 'true'">
       <Link>Common\Interop\Unix\Interop.Libraries.cs</Link>
     </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\NetEventSource.Common.cs">
+      <Link>Common\System\Net\Http\aspnetcore\NetEventSource.Common.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicAddressHelpers.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicAddressHelpers.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicApi.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicApi.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicParameterHelpers.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicParameterHelpers.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSecurityConfig.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSecurityConfig.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSession.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\MsQuicSession.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\QuicExceptionHelpers.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\QuicExceptionHelpers.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\ResettableCompletionSource.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\Internal\ResettableCompletionSource.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicConnection.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicConnection.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicImplementationProvider.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicImplementationProvider.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicListener.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicListener.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicStream.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\MsQuic\MsQuicStream.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicImplementationProvider.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicImplementationProvider.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicListenerProvider.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicListenerProvider.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicConnectionProvider.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicConnectionProvider.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\QuicStreamProvider.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\QuicStreamProvider.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockImplementationProvider.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockImplementationProvider.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockListener.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockListener.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockConnection.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockConnection.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockStream.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Implementations\Mock\MockStream.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusCodes.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusCodes.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusHelper.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicStatusHelper.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\NetEventSource.Quic.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\NetEventSource.Quic.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicClientConnectionOptions.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicClientConnectionOptions.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicImplementationProviders.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicImplementationProviders.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicConnection.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicConnection.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicListener.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicListener.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicListenerOptions.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicListenerOptions.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicOperationAbortedException.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicOperationAbortedException.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicStream.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicStream.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicException.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicException.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicConnectionAbortedException.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicConnectionAbortedException.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\QuicStreamAbortedException.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\QuicStreamAbortedException.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\Interop.MsQuic.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\Interop.MsQuic.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicEnums.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicEnums.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Quic\Interop\MsQuicNativeMethods.cs" >
+      <Link>Common\System\Net\Http\aspnetcore\Quic\Interop\MsQuicNativeMethods.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs">
+      <Link>System\System\Threading\Tasks\TaskToApm.cs</Link>
+    </Compile>
     <Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.IsNtlmInstalled.cs" Condition="'$(TargetsUnix)' == 'true'">
       <Link>Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.IsNtlmInstalled.cs</Link>
     </Compile>
     </Compile>
     <Compile Include="HttpRequestMessageTest.cs" />
     <Compile Include="HttpResponseMessageTest.cs" />
+    <Compile Include="MsQuicTestBase.cs" />
+    <Compile Include="MsQuicTests.cs" />
     <Compile Include="MessageProcessingHandlerTest.cs" />
     <Compile Include="MultipartContentTest.cs" />
     <Compile Include="MultipartFormDataContentTest.cs" />
     <Compile Include="$(CommonTestPath)System\Net\Http\PostScenarioTest.cs">
       <Link>Common\System\Net\Http\PostScenarioTest.cs</Link>
     </Compile>
+    <Compile Include="QuicConnectionTests.cs" />
+    <Compile Include="QuicListenerTests.cs" />
+    <Compile Include="QuicStreamTests.cs" />
     <Compile Include="$(CommonTestPath)System\Net\Http\RepeatedFlushContent.cs">
       <Link>Common\System\Net\Http\RepeatedFlushContent.cs</Link>
     </Compile>
     <Compile Include="ThrowingContent.cs" />
     <Compile Include="Watchdog.cs" />
   </ItemGroup>
+  <!-- Windows specific files -->
+  <ItemGroup Condition=" '$(TargetsWindows)' == 'true'">
+    <Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs">
+      <Link>Common\Interop\Windows\Interop.Libraries.cs</Link>
+    </Compile>
+  </ItemGroup>
+  <!-- Linux specific files -->
+  <ItemGroup Condition="'$(TargetsLinux)' == 'true' ">
+    <Compile Include="$(CommonPath)Interop\Linux\Interop.Libraries.cs">
+      <Link>Common\Interop\Linux\Interop.Libraries.cs</Link>
+    </Compile>
+  </ItemGroup>
+  <!-- OSX specific files -->
+  <ItemGroup Condition=" '$(TargetsOSX)' == 'true' ">
+    <Compile Include="$(CommonPath)Interop\OSX\Interop.Libraries.cs">
+      <Link>Common\Interop\OSX\Interop.Libraries.cs</Link>
+    </Compile>
+  </ItemGroup>
   <ItemGroup>
     <Compile Include="CustomContent.netcore.cs" />
     <Compile Include="HPackTest.cs" />
diff --git a/src/libraries/System.Net.Quic/Directory.Build.props b/src/libraries/System.Net.Quic/Directory.Build.props
deleted file mode 100644 (file)
index 23ff074..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<Project>
-  <Import Project="..\Directory.Build.props" />
-  <PropertyGroup>
-    <AssemblyVersion>4.2.1.0</AssemblyVersion>
-    <StrongNameKeyId>Microsoft</StrongNameKeyId>
-    <IsNETCoreApp>true</IsNETCoreApp>
-    <!-- This is a preview package. Do not mark as stable. -->
-    <SuppressFinalPackageVersion>true</SuppressFinalPackageVersion>
-    <IsShippingAssembly>false</IsShippingAssembly>
-  </PropertyGroup>
-</Project>
diff --git a/src/libraries/System.Net.Quic/System.Net.Quic.sln b/src/libraries/System.Net.Quic/System.Net.Quic.sln
deleted file mode 100644 (file)
index 7b503d9..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.27213.1
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Net.Quic.Tests", "tests\FunctionalTests\System.Net.Quic.Tests.csproj", "{8CBA022C-635F-4C8D-9D29-CD8AAC68C8E6}"
-       ProjectSection(ProjectDependencies) = postProject
-               {43311AFB-D7C4-4E5A-B1DE-855407F90D1B} = {43311AFB-D7C4-4E5A-B1DE-855407F90D1B}
-       EndProjectSection
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Net.Quic", "src\System.Net.Quic.csproj", "{43311AFB-D7C4-4E5A-B1DE-855407F90D1B}"
-       ProjectSection(ProjectDependencies) = postProject
-               {834E3534-6A11-4A8D-923F-35C1E71CCEC3} = {834E3534-6A11-4A8D-923F-35C1E71CCEC3}
-       EndProjectSection
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Net.Quic", "ref\System.Net.Quic.csproj", "{834E3534-6A11-4A8D-923F-35C1E71CCEC3}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{1A2F9F4A-A032-433E-B914-ADD5992BB178}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E107E9C1-E893-4E87-987E-04EF0DCEAEFD}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{2E666815-2EDB-464B-9DF6-380BF4789AD4}"
-EndProject
-Global
-       GlobalSection(SolutionConfigurationPlatforms) = preSolution
-               Debug|Any CPU = Debug|Any CPU
-               Release|Any CPU = Release|Any CPU
-       EndGlobalSection
-       GlobalSection(ProjectConfigurationPlatforms) = postSolution
-               {8CBA022C-635F-4C8D-9D29-CD8AAC68C8E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {8CBA022C-635F-4C8D-9D29-CD8AAC68C8E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {8CBA022C-635F-4C8D-9D29-CD8AAC68C8E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {8CBA022C-635F-4C8D-9D29-CD8AAC68C8E6}.Release|Any CPU.Build.0 = Release|Any CPU
-               {43311AFB-D7C4-4E5A-B1DE-855407F90D1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {43311AFB-D7C4-4E5A-B1DE-855407F90D1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {43311AFB-D7C4-4E5A-B1DE-855407F90D1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {43311AFB-D7C4-4E5A-B1DE-855407F90D1B}.Release|Any CPU.Build.0 = Release|Any CPU
-               {834E3534-6A11-4A8D-923F-35C1E71CCEC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {834E3534-6A11-4A8D-923F-35C1E71CCEC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {834E3534-6A11-4A8D-923F-35C1E71CCEC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {834E3534-6A11-4A8D-923F-35C1E71CCEC3}.Release|Any CPU.Build.0 = Release|Any CPU
-       EndGlobalSection
-       GlobalSection(SolutionProperties) = preSolution
-               HideSolutionNode = FALSE
-       EndGlobalSection
-       GlobalSection(NestedProjects) = preSolution
-               {8CBA022C-635F-4C8D-9D29-CD8AAC68C8E6} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
-               {43311AFB-D7C4-4E5A-B1DE-855407F90D1B} = {E107E9C1-E893-4E87-987E-04EF0DCEAEFD}
-               {834E3534-6A11-4A8D-923F-35C1E71CCEC3} = {2E666815-2EDB-464B-9DF6-380BF4789AD4}
-       EndGlobalSection
-       GlobalSection(ExtensibilityGlobals) = postSolution
-               SolutionGuid = {6E33D5E2-B9BF-49D1-99FA-3C9AC3412636}
-       EndGlobalSection
-EndGlobal
diff --git a/src/libraries/System.Net.Quic/ref/System.Net.Quic.Temporary.cs b/src/libraries/System.Net.Quic/ref/System.Net.Quic.Temporary.cs
deleted file mode 100644 (file)
index 3080f84..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-// ------------------------------------------------------------------------------
-// Changes to this file must follow the https://aka.ms/api-review process.
-// ------------------------------------------------------------------------------
-
-using System.Threading;
-
-namespace System.Net.Quic
-{
-    public sealed partial class QuicConnection : System.IDisposable
-    {
-        public QuicConnection(System.Net.Quic.Implementations.QuicImplementationProvider implementationProvider, IPEndPoint remoteEndPoint, System.Net.Security.SslClientAuthenticationOptions sslClientAuthenticationOptions, IPEndPoint localEndPoint = null) { }
-        public QuicConnection(System.Net.Quic.Implementations.QuicImplementationProvider implementationProvider, QuicClientConnectionOptions options) { }
-    }
-    public sealed partial class QuicListener : IDisposable
-    {
-        public QuicListener(System.Net.Quic.Implementations.QuicImplementationProvider implementationProvider, IPEndPoint listenEndPoint, System.Net.Security.SslServerAuthenticationOptions sslServerAuthenticationOptions) { }
-        public QuicListener(System.Net.Quic.Implementations.QuicImplementationProvider implementationProvider, QuicListenerOptions option) { }
-    }
-    public static class QuicImplementationProviders
-    {
-        public static System.Net.Quic.Implementations.QuicImplementationProvider Mock { get { throw null; } }
-        public static System.Net.Quic.Implementations.QuicImplementationProvider MsQuic { get { throw null; } }
-        public static System.Net.Quic.Implementations.QuicImplementationProvider Default { get { throw null; } }
-    }
-}
-namespace System.Net.Quic.Implementations
-{ 
-    public abstract class QuicImplementationProvider
-    {
-        internal QuicImplementationProvider() { }
-    }
-}
diff --git a/src/libraries/System.Net.Quic/ref/System.Net.Quic.cs b/src/libraries/System.Net.Quic/ref/System.Net.Quic.cs
deleted file mode 100644 (file)
index 80fbd28..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-// ------------------------------------------------------------------------------
-// Changes to this file must follow the https://aka.ms/api-review process.
-// ------------------------------------------------------------------------------
-
-using System.Buffers;
-using System.Net.Security;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace System.Net.Quic
-{
-    public sealed partial class QuicConnection : System.IDisposable
-    {
-        public QuicConnection(IPEndPoint remoteEndPoint, System.Net.Security.SslClientAuthenticationOptions sslClientAuthenticationOptions, IPEndPoint localEndPoint = null) { }
-        public System.Threading.Tasks.ValueTask ConnectAsync(System.Threading.CancellationToken cancellationToken = default) { throw null; }
-        public bool Connected => throw null;
-        public IPEndPoint LocalEndPoint => throw null;
-        public IPEndPoint RemoteEndPoint => throw null;
-        public QuicStream OpenUnidirectionalStream() => throw null;
-        public QuicStream OpenBidirectionalStream() => throw null;
-        public long GetRemoteAvailableUnidirectionalStreamCount() => throw null;
-        public long GetRemoteAvailableBidirectionalStreamCount() => throw null;
-        public System.Threading.Tasks.ValueTask<QuicStream> AcceptStreamAsync(System.Threading.CancellationToken cancellationToken = default) => throw null;
-        public System.Net.Security.SslApplicationProtocol NegotiatedApplicationProtocol => throw null;
-        public ValueTask CloseAsync(long errorCode, System.Threading.CancellationToken cancellationToken = default) => throw null;
-        public void Dispose() => throw null;
-        public static bool IsQuicSupported => throw null;
-    }
-    public sealed partial class QuicListener : IDisposable
-    {
-        public QuicListener(IPEndPoint listenEndPoint, System.Net.Security.SslServerAuthenticationOptions sslServerAuthenticationOptions) { }
-        public IPEndPoint ListenEndPoint => throw null;
-        public System.Threading.Tasks.ValueTask<QuicConnection> AcceptConnectionAsync(System.Threading.CancellationToken cancellationToken = default) => throw null;
-        public void Start() => throw null;
-        public void Close() => throw null;
-        public void Dispose() => throw null;
-    }
-    public sealed class QuicStream : System.IO.Stream
-    {
-        internal QuicStream() { }
-        public override bool CanSeek => throw null;
-        public override long Length => throw null;
-        public override long Seek(long offset, System.IO.SeekOrigin origin) => throw null;
-        public override void SetLength(long value) => throw null;
-        public override long Position { get => throw null; set => throw null; }
-        public override bool CanRead => throw null;
-        public override bool CanWrite => throw null;
-        public override void Flush() => throw null;
-        public override int Read(byte[] buffer, int offset, int count) => throw null;
-        public override void Write(byte[] buffer, int offset, int count) => throw null;
-        public long StreamId => throw null;
-        public void AbortRead(long errorCode) => throw null;
-        public void AbortWrite(long errorCode) => throw null;
-        public ValueTask WriteAsync(ReadOnlyMemory<byte> data, bool endStream, System.Threading.CancellationToken cancellationToken = default) => throw null;
-        public ValueTask WriteAsync(ReadOnlySequence<byte> data, System.Threading.CancellationToken cancellationToken = default) => throw null;
-        public ValueTask WriteAsync(ReadOnlySequence<byte> data, bool endStream, System.Threading.CancellationToken cancellationToken = default) => throw null;
-        public ValueTask WriteAsync(ReadOnlyMemory<ReadOnlyMemory<byte>> data, System.Threading.CancellationToken cancellationToken = default) => throw null;
-        public ValueTask WriteAsync(ReadOnlyMemory<ReadOnlyMemory<byte>> data, bool endStream, System.Threading.CancellationToken cancellationToken = default) => throw null;
-        public ValueTask ShutdownWriteCompleted(System.Threading.CancellationToken cancellationToken = default) => throw null;
-        public void Shutdown() => throw null;
-    }
-    public class QuicClientConnectionOptions
-    {
-        public SslClientAuthenticationOptions ClientAuthenticationOptions { get => throw null; set => throw null; }
-        public IPEndPoint LocalEndPoint { get => throw null; set => throw null; }
-        public IPEndPoint RemoteEndPoint { get => throw null; set => throw null; }
-        public long MaxBidirectionalStreams { get => throw null; set => throw null; }
-        public long MaxUnidirectionalStreams { get => throw null; set => throw null; }
-        public TimeSpan IdleTimeout { get => throw null; set => throw null; }
-    }
-    public class QuicListenerOptions
-    {
-        public SslServerAuthenticationOptions ServerAuthenticationOptions { get => throw null; set => throw null; }
-        public string CertificateFilePath { get => throw null; set => throw null; }
-        public string PrivateKeyFilePath { get => throw null; set => throw null; }
-        public IPEndPoint ListenEndPoint { get => throw null; set => throw null; }
-        public int ListenBacklog { get => throw null; set => throw null; }
-        public long MaxBidirectionalStreams { get => throw null; set => throw null; }
-        public long MaxUnidirectionalStreams { get => throw null; set => throw null; }
-        public TimeSpan IdleTimeout { get => throw null; set => throw null; }
-    }
-    public class QuicException : Exception
-    {
-        public QuicException(string message) : base(message) { }
-    }
-    public class QuicConnectionAbortedException : QuicException
-    {
-        public QuicConnectionAbortedException(string message, long errorCode) : base(message) { }
-        public long ErrorCode { get; }
-
-    }
-    public class QuicStreamAbortedException : QuicException
-    {
-        public QuicStreamAbortedException(string message, long errorCode) : base(message) { }
-        public long ErrorCode { get; }
-    }
-    public class QuicOperationAbortedException : QuicException
-    {
-        public QuicOperationAbortedException(string message) : base(message) { }
-    }
-}
diff --git a/src/libraries/System.Net.Quic/ref/System.Net.Quic.csproj b/src/libraries/System.Net.Quic/ref/System.Net.Quic.csproj
deleted file mode 100644 (file)
index ae388ea..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-  <PropertyGroup>
-    <TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
-  </PropertyGroup>
-  <ItemGroup>
-    <Compile Include="System.Net.Quic.Temporary.cs" />
-    <Compile Include="System.Net.Quic.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\System.Memory\ref\System.Memory.csproj" />
-    <ProjectReference Include="..\..\System.IO.FileSystem.Primitives\ref\System.IO.FileSystem.Primitives.csproj" />
-    <ProjectReference Include="..\..\System.Net.Primitives\ref\System.Net.Primitives.csproj" />
-    <ProjectReference Include="..\..\System.Net.Security\ref\System.Net.Security.csproj" />
-    <ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
-  </ItemGroup>
-</Project>
diff --git a/src/libraries/System.Net.Quic/src/Interop/Linux/MsQuicStatusCodes.cs b/src/libraries/System.Net.Quic/src/Interop/Linux/MsQuicStatusCodes.cs
deleted file mode 100644 (file)
index 4152fde..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System.Runtime.InteropServices;
-
-namespace System.Net.Quic.Implementations.MsQuic.Internal
-{
-    internal static class MsQuicStatusCodes
-    {
-        internal const uint Success = 0;
-        internal const uint Pending = unchecked((uint)-2);
-        internal const uint Continue = unchecked((uint)-1);
-        internal const uint OutOfMemory = 12;
-        internal const uint InvalidParameter = 22;
-        internal const uint InvalidState = 200000002;
-        internal const uint NotSupported = 95;
-        internal const uint NotFound = 2;
-        internal const uint BufferTooSmall = 75;
-        internal const uint HandshakeFailure = 200000009;
-        internal const uint Aborted = 200000008;
-        internal const uint AddressInUse = 98;
-        internal const uint ConnectionTimeout = 110;
-        internal const uint ConnectionIdle = 200000011;
-        internal const uint InternalError = 200000012;
-        internal const uint ServerBusy = 200000007;
-        internal const uint ProtocolError = 200000013;
-        internal const uint VerNegError = 200000014;
-
-        public static string GetError(uint status)
-        {
-            return status switch
-            {
-                Success => "SUCCESS",
-                Pending => "PENDING",
-                Continue => "CONTINUE",
-                OutOfMemory => "OUT_OF_MEMORY",
-                InvalidParameter => "INVALID_PARAMETER",
-                InvalidState => "INVALID_STATE",
-                NotSupported => "NOT_SUPPORTED",
-                NotFound => "NOT_FOUND",
-                BufferTooSmall => "BUFFER_TOO_SMALL",
-                HandshakeFailure => "HANDSHAKE_FAILURE",
-                Aborted => "ABORTED",
-                AddressInUse => "ADDRESS_IN_USE",
-                ConnectionTimeout => "CONNECTION_TIMEOUT",
-                ConnectionIdle => "CONNECTION_IDLE",
-                InternalError => "INTERNAL_ERROR",
-                ServerBusy => "SERVER_BUSY",
-                ProtocolError => "PROTOCOL_ERROR",
-                VerNegError => "VER_NEG_ERROR",
-                _ => status.ToString()
-            };
-        }
-    }
-}
diff --git a/src/libraries/System.Net.Quic/src/Interop/OSX/MsQuicStatusCodes.cs b/src/libraries/System.Net.Quic/src/Interop/OSX/MsQuicStatusCodes.cs
deleted file mode 100644 (file)
index 60c1bec..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System.Runtime.InteropServices;
-
-namespace System.Net.Quic.Implementations.MsQuic.Internal
-{
-    internal static class MsQuicStatusCodes
-    {
-        internal const uint Success = 0;
-        internal const uint Pending = unchecked((uint)-2);
-        internal const uint Continue = unchecked((uint)-1);
-        internal const uint OutOfMemory = 12;
-        internal const uint InvalidParameter = 22;
-        internal const uint InvalidState = 200000002;
-        internal const uint NotSupported = 95;
-        internal const uint NotFound = 2;
-        internal const uint BufferTooSmall = 75;
-        internal const uint HandshakeFailure = 200000009;
-        internal const uint Aborted = 200000008;
-        internal const uint AddressInUse = 98;
-        internal const uint ConnectionTimeout = 110;
-        internal const uint ConnectionIdle = 200000011;
-        internal const uint InternalError = 200000012;
-        internal const uint ServerBusy = 200000007;
-        internal const uint ProtocolError = 200000013;
-        internal const uint VerNegError = 200000014;
-
-        public static string GetError(uint status)
-        {
-            throw new NotImplementedException();
-        }
-    }
-}
diff --git a/src/libraries/System.Net.Quic/src/Interop/OSX/MsQuicStatusHelper.cs b/src/libraries/System.Net.Quic/src/Interop/OSX/MsQuicStatusHelper.cs
deleted file mode 100644 (file)
index cae5db4..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System.Runtime.InteropServices;
-
-namespace System.Net.Quic.Implementations.MsQuic.Internal
-{
-    internal static class MsQuicStatusHelper
-    {
-        internal static bool SuccessfulStatusCode(uint status)
-        {
-            throw new NotImplementedException();
-        }
-    }
-}
diff --git a/src/libraries/System.Net.Quic/src/Interop/Windows/MsQuicStatusCodes.cs b/src/libraries/System.Net.Quic/src/Interop/Windows/MsQuicStatusCodes.cs
deleted file mode 100644 (file)
index 1d0513e..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-namespace System.Net.Quic.Implementations.MsQuic.Internal
-{
-    internal static class MsQuicStatusCodes
-    {
-        internal const uint Success = 0;
-        internal const uint Pending = 0x703E5;
-        internal const uint Continue = 0x704DE;
-        internal const uint OutOfMemory = 0x8007000E;
-        internal const uint InvalidParameter = 0x80070057;
-        internal const uint InvalidState = 0x8007139F;
-        internal const uint NotSupported = 0x80004002;
-        internal const uint NotFound = 0x80070490;
-        internal const uint BufferTooSmall = 0x8007007A;
-        internal const uint HandshakeFailure = 0x80410000;
-        internal const uint Aborted = 0x80004004;
-        internal const uint AddressInUse = 0x80072740;
-        internal const uint ConnectionTimeout = 0x800704CF;
-        internal const uint ConnectionIdle = 0x800704D4;
-        internal const uint InternalError = 0x80004005;
-        internal const uint ServerBusy = 0x800704C9;
-        internal const uint ProtocolError = 0x800704CD;
-        internal const uint HostUnreachable = 0x800704D0;
-        internal const uint VerNegError = 0x80410001;
-
-        // TODO return better error messages here.
-        public static string GetError(uint status)
-        {
-            return status switch
-            {
-                Success => "SUCCESS",
-                Pending => "PENDING",
-                Continue => "CONTINUE",
-                OutOfMemory => "OUT_OF_MEMORY",
-                InvalidParameter => "INVALID_PARAMETER",
-                InvalidState => "INVALID_STATE",
-                NotSupported => "NOT_SUPPORTED",
-                NotFound => "NOT_FOUND",
-                BufferTooSmall => "BUFFER_TOO_SMALL",
-                HandshakeFailure => "HANDSHAKE_FAILURE",
-                Aborted => "ABORTED",
-                AddressInUse => "ADDRESS_IN_USE",
-                ConnectionTimeout => "CONNECTION_TIMEOUT",
-                ConnectionIdle => "CONNECTION_IDLE",
-                InternalError => "INTERNAL_ERROR",
-                ServerBusy => "SERVER_BUSY",
-                ProtocolError => "PROTOCOL_ERROR",
-                VerNegError => "VER_NEG_ERROR",
-                _ => status.ToString()
-            };
-        }
-    }
-}
diff --git a/src/libraries/System.Net.Quic/src/Interop/Windows/MsQuicStatusHelper.cs b/src/libraries/System.Net.Quic/src/Interop/Windows/MsQuicStatusHelper.cs
deleted file mode 100644 (file)
index 8491873..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System.Runtime.InteropServices;
-
-namespace System.Net.Quic.Implementations.MsQuic.Internal
-{
-    internal static class MsQuicStatusHelper
-    {
-        internal static bool SuccessfulStatusCode(uint status)
-        {
-            return status < 0x80000000;
-        }
-    }
-}
diff --git a/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj b/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj
deleted file mode 100644 (file)
index 729c019..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-  <PropertyGroup>
-    <AssemblyName>System.Net.Quic</AssemblyName>
-    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-    <TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX</TargetFrameworks>
-    <EnablePInvokeAnalyzer>false</EnablePInvokeAnalyzer>
-  </PropertyGroup>
-  <ItemGroup>
-    <!-- All configurations -->
-    <Compile Include="System\Net\Quic\Implementations\MsQuic\Internal\MsQuicAddressHelpers.cs" />
-    <Compile Include="System\Net\Quic\Implementations\MsQuic\Internal\MsQuicApi.cs" />
-    <Compile Include="System\Net\Quic\Implementations\MsQuic\Internal\MsQuicParameterHelpers.cs" />
-    <Compile Include="System\Net\Quic\Implementations\MsQuic\Internal\MsQuicSecurityConfig.cs" />
-    <Compile Include="System\Net\Quic\Implementations\MsQuic\Internal\MsQuicSession.cs" />
-    <Compile Include="System\Net\Quic\Implementations\MsQuic\Internal\QuicExceptionHelpers.cs" />
-    <Compile Include="System\Net\Quic\Implementations\MsQuic\Internal\ResettableCompletionSource.cs" />
-    <Compile Include="System\Net\Quic\Implementations\MsQuic\MsQuicConnection.cs" />
-    <Compile Include="System\Net\Quic\Implementations\MsQuic\MsQuicImplementationProvider.cs" />
-    <Compile Include="System\Net\Quic\Implementations\MsQuic\MsQuicListener.cs" />
-    <Compile Include="System\Net\Quic\Implementations\MsQuic\MsQuicStream.cs" />
-    <Compile Include="System\Net\Quic\Implementations\QuicImplementationProvider.cs" />
-    <Compile Include="System\Net\Quic\Implementations\QuicListenerProvider.cs" />
-    <Compile Include="System\Net\Quic\Implementations\QuicConnectionProvider.cs" />
-    <Compile Include="System\Net\Quic\Implementations\QuicStreamProvider.cs" />
-    <Compile Include="System\Net\Quic\Implementations\Mock\MockImplementationProvider.cs" />
-    <Compile Include="System\Net\Quic\Implementations\Mock\MockListener.cs" />
-    <Compile Include="System\Net\Quic\Implementations\Mock\MockConnection.cs" />
-    <Compile Include="System\Net\Quic\Implementations\Mock\MockStream.cs" />
-    <Compile Include="System\Net\Quic\NetEventSource.Quic.cs" />
-    <Compile Include="System\Net\Quic\QuicClientConnectionOptions.cs" />
-    <Compile Include="System\Net\Quic\QuicImplementationProviders.cs" />
-    <Compile Include="System\Net\Quic\QuicConnection.cs" />
-    <Compile Include="System\Net\Quic\QuicListener.cs" />
-    <Compile Include="System\Net\Quic\QuicListenerOptions.cs" />
-    <Compile Include="System\Net\Quic\QuicOperationAbortedException.cs" />
-    <Compile Include="System\Net\Quic\QuicStream.cs" />
-    <Compile Include="System\Net\Quic\QuicException.cs" />
-    <Compile Include="System\Net\Quic\QuicConnectionAbortedException.cs" />
-    <Compile Include="System\Net\Quic\QuicStreamAbortedException.cs" />
-    <Compile Include="Interop\Interop.MsQuic.cs" />
-    <Compile Include="Interop\MsQuicEnums.cs" />
-    <Compile Include="Interop\MsQuicNativeMethods.cs" />
-    <Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs">
-      <Link>Common\System\Threading\Tasks\TaskToApm.cs</Link>
-    </Compile>
-    <Compile Include="$(CommonPath)System\Net\Logging\NetEventSource.Common.cs">
-      <Link>Common\System\Net\Logging\NetEventSource.Common.cs</Link>
-    </Compile>
-  </ItemGroup>
-  <!-- Windows specific files -->
-  <ItemGroup Condition=" '$(TargetsWindows)' == 'true'">
-    <Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs">
-      <Link>Common\Interop\Windows\Interop.Libraries.cs</Link>
-    </Compile>
-    <Compile Include="Interop\Windows\MsQuicStatusCodes.cs" />
-    <Compile Include="Interop\Windows\MsQuicStatusHelper.cs" />
-  </ItemGroup>
-  <!-- Linux specific files -->
-  <ItemGroup Condition="'$(TargetsLinux)' == 'true' ">
-    <Compile Include="$(CommonPath)Interop\Linux\Interop.Libraries.cs">
-      <Link>Common\Interop\Linux\Interop.Libraries.cs</Link>
-    </Compile>
-    <Compile Include="Interop\Linux\MsQuicStatusCodes.cs" />
-    <Compile Include="Interop\Linux\MsQuicStatusHelper.cs" />
-  </ItemGroup>
-  <!-- OSX specific files -->
-  <ItemGroup Condition=" '$(TargetsOSX)' == 'true' ">
-    <Compile Include="$(CommonPath)Interop\OSX\Interop.Libraries.cs">
-      <Link>Common\Interop\OSX\Interop.Libraries.cs</Link>
-    </Compile>
-    <Compile Include="Interop\OSX\MsQuicStatusCodes.cs" />
-    <Compile Include="Interop\Linux\MsQuicStatusHelper.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <Reference Include="System.Console" />
-    <Reference Include="System.Collections" />
-    <Reference Include="System.Diagnostics.Tracing" />
-    <Reference Include="System.Memory" />
-    <Reference Include="System.Net.NameResolution" />
-    <Reference Include="System.Net.Primitives" />
-    <Reference Include="System.Net.Security" />
-    <Reference Include="System.Net.Sockets" />
-    <Reference Include="System.Net" />
-    <Reference Include="System.Runtime" />
-    <Reference Include="System.Runtime.Extensions" />
-    <Reference Include="System.Runtime.InteropServices" />
-    <Reference Include="System.Runtime.InteropServices.RuntimeInformation" />
-    <Reference Include="System.Security.Cryptography.X509Certificates" />
-    <Reference Include="System.Threading" />
-    <Reference Include="System.Threading.Channels" />
-    <Reference Include="System.Threading.ThreadPool" />
-  </ItemGroup>
-  <ItemGroup>
-    <Content Include="msquic.dll" Condition="Exists('msquic.dll')">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
-    </Content>
-    <Content Include="libmsquic.so" Condition="Exists('libmsquic.so')">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
-    </Content>
-    <Content Include="msquic.pdb" Condition="Exists('msquic.pdb')">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
-    </Content>
-  </ItemGroup>
-</Project>
diff --git a/src/libraries/System.Net.Quic/tests/FunctionalTests/System.Net.Quic.Tests.csproj b/src/libraries/System.Net.Quic/tests/FunctionalTests/System.Net.Quic.Tests.csproj
deleted file mode 100644 (file)
index aa9c1be..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-  <PropertyGroup>
-    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-    <TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix</TargetFrameworks>
-  </PropertyGroup>
-  <ItemGroup>
-    <Compile Include="MsQuicTestBase.cs" />
-    <Compile Include="MsQuicTests.cs" />
-    <Compile Include="QuicConnectionTests.cs" />
-    <Compile Include="$(CommonTestPath)System\Diagnostics\Tracing\ConsoleEventListener.cs">
-      <Link>Common\System\Diagnostics\Tracing\ConsoleEventListener.cs</Link>
-    </Compile>
-    <Compile Include="$(CommonTestPath)\System\Threading\Tasks\TaskTimeoutExtensions.cs">
-      <Link>Common\System\Threading\Tasks\TaskTimeoutExtensions.cs</Link>
-    </Compile>
-    <Compile Include="QuicListenerTests.cs" />
-    <Compile Include="QuicStreamTests.cs" />
-  </ItemGroup>
-</Project>
\ No newline at end of file