From 561d61ab3f297bc9f3b5156146b26f3c6cfb88de Mon Sep 17 00:00:00 2001 From: ManickaP Date: Tue, 7 Mar 2023 15:17:07 +0100 Subject: [PATCH] Test with worker queue delay --- .../src/System/Net/Quic/Internal/MsQuicApi.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Internal/MsQuicApi.cs b/src/libraries/System.Net.Quic/src/System/Net/Quic/Internal/MsQuicApi.cs index 47b727a7a591fe..b0914908d541fd 100644 --- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Internal/MsQuicApi.cs +++ b/src/libraries/System.Net.Quic/src/System/Net/Quic/Internal/MsQuicApi.cs @@ -48,6 +48,17 @@ private MsQuicApi(QUIC_API_TABLE* apiTable) ThrowHelper.ThrowIfMsQuicError(ApiTable->RegistrationOpen(&cfg, &handle), "RegistrationOpen failed"); Registration = new MsQuicSafeHandle(handle, apiTable->RegistrationClose, SafeHandleType.Registration); + + QUIC_SETTINGS settings = default(QUIC_SETTINGS); + settings.IsSet.MaxWorkerQueueDelayUs = 1; + settings.MaxWorkerQueueDelayUs = (uint)TimeSpan.FromSeconds(2.5).TotalMicroseconds; + if (StatusFailed(ApiTable->SetParam(null, QUIC_PARAM_GLOBAL_SETTINGS, (uint)sizeof(QUIC_SETTINGS), (byte*)&settings))) + { + if (NetEventSource.Log.IsEnabled()) + { + NetEventSource.Info(null, $"Unable to set MsQuic MaxWorkerQueueDelayUs."); + } + } } }