Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetHttp3ConnectionAsync()

async ValueTask< Http3Connection > System.Net.Http.HttpConnectionPool.GetHttp3ConnectionAsync ( HttpRequestMessage request,
HttpAuthority authority,
CancellationToken cancellationToken )
inlineprivate

Definition at line 673 of file HttpConnectionPool.cs.

674 {
676 if (http3Connection != null)
677 {
679 {
680 if (System.Net.NetEventSource.Log.IsEnabled())
681 {
682 Trace("Using existing HTTP3 connection.", "GetHttp3ConnectionAsync");
683 }
685 return http3Connection;
686 }
687 if (System.Net.NetEventSource.Log.IsEnabled())
688 {
689 http3Connection.Trace("Found expired HTTP3 connection.", "GetHttp3ConnectionAsync");
690 }
691 http3Connection.Dispose();
693 }
694 if (_http3ConnectionCreateLock == null)
695 {
696 lock (SyncObj)
697 {
698 if (_http3ConnectionCreateLock == null)
699 {
701 }
702 }
703 }
705 try
706 {
707 if (_http3Connection != null)
708 {
709 if (System.Net.NetEventSource.Log.IsEnabled())
710 {
711 Trace("Using existing HTTP3 connection.", "GetHttp3ConnectionAsync");
712 }
713 return _http3Connection;
714 }
715 if (System.Net.NetEventSource.Log.IsEnabled())
716 {
717 Trace("Attempting new HTTP3 connection.", "GetHttp3ConnectionAsync");
718 }
719 QuicConnection connection;
720 try
721 {
722 connection = await ConnectHelper.ConnectQuicAsync(request, Settings._quicImplementationProvider ?? QuicImplementationProviders.Default, new DnsEndPoint(authority.IdnHost, authority.Port), _sslOptionsHttp3, cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
723 }
724 catch
725 {
727 throw;
728 }
729 http3Connection = (_http3Connection = new Http3Connection(this, _originAuthority, authority, connection));
730 if (System.Net.NetEventSource.Log.IsEnabled())
731 {
732 Trace("New HTTP3 connection established.", "GetHttp3ConnectionAsync");
733 }
734 return http3Connection;
735 }
736 finally
737 {
739 }
740 }
readonly SslClientAuthenticationOptions _sslOptionsHttp3
void InvalidateHttp3Connection(Http3Connection connection)
void BlocklistAuthority(HttpAuthority badAuthority)
bool CheckExpirationOnGet(HttpConnectionBase connection)
void Trace(string message, [CallerMemberName] string memberName=null)
QuicImplementationProvider _quicImplementationProvider
static readonly System.Net.NetEventSource Log
new ConfiguredTaskAwaitable< TResult > ConfigureAwait(bool continueOnCapturedContext)
Definition Task.cs:226
static bool Read(ref bool location)
Definition Volatile.cs:67

References System.Net.Http.HttpConnectionPool._http3Connection, System.Net.Http.HttpConnectionPool._http3ConnectionCreateLock, System.Net.Http.HttpConnectionPool._originAuthority, System.Net.Http.HttpConnectionSettings._quicImplementationProvider, System.Net.Http.HttpConnectionPool._sslOptionsHttp3, System.Net.Http.HttpConnectionPool._usedSinceLastCleanup, System.Net.Http.HttpConnectionPool.BlocklistAuthority(), System.cancellationToken, System.Net.Http.HttpConnectionPool.CheckExpirationOnGet(), System.Threading.Tasks.Task< TResult >.ConfigureAwait(), System.Net.Http.ConnectHelper.ConnectQuicAsync(), System.Net.Quic.QuicImplementationProviders.Default, System.Net.Http.HttpConnectionPool.InvalidateHttp3Connection(), System.Net.NetEventSource.Log, System.Threading.Volatile.Read(), System.Threading.SemaphoreSlim.Release(), System.Net.Http.HttpConnectionPool.Settings, System.Net.Http.HttpConnectionPool.SyncObj, System.Net.Http.HttpConnectionPool.Trace(), and System.Threading.SemaphoreSlim.WaitAsync().

Referenced by System.Net.Http.HttpConnectionPool.TrySendUsingHttp3Async().