diff options
| author | Neuheit <38368299+Neuheit@users.noreply.github.com> | 2022-12-08 00:17:46 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-08 00:17:46 -0500 |
| commit | a7fc5e6e12e2330344640c92cc4d0afc36c74fe2 (patch) | |
| tree | 2c2b211e65704c35e8f0ff5b9147865013ae287c | |
| parent | 9e791a92c3dbf12420ec13e8c0b15f70d4dcba78 (diff) | |
Add additional awaiter code comment.
| -rw-r--r-- | Jellyfin.Networking/HappyEyeballs/HttpClientExtension.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Jellyfin.Networking/HappyEyeballs/HttpClientExtension.cs b/Jellyfin.Networking/HappyEyeballs/HttpClientExtension.cs index 0ceaeaf96..add70c9cd 100644 --- a/Jellyfin.Networking/HappyEyeballs/HttpClientExtension.cs +++ b/Jellyfin.Networking/HappyEyeballs/HttpClientExtension.cs @@ -60,6 +60,9 @@ namespace Jellyfin.Networking.HappyEyeballs using var cancelIPv6 = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); var tryConnectAsyncIPv6 = AttemptConnection(AddressFamily.InterNetworkV6, context, cancelIPv6.Token); + //This connect task uses GetAwaiter().GetResult() as the appropriate task has already been completed. + //This results in improved exception handling. + //See https://github.com/dotnet/corefx/pull/29792/files#r189415885 for more details. if (await Task.WhenAny(tryConnectAsyncIPv6, Task.Delay(200, cancelIPv6.Token)).ConfigureAwait(false) == tryConnectAsyncIPv6 && tryConnectAsyncIPv6.IsCompletedSuccessfully) { cancelIPv6.Cancel(); @@ -71,7 +74,6 @@ namespace Jellyfin.Networking.HappyEyeballs //Both connect tasks use GetAwaiter().GetResult() as the appropriate task has already been completed. //This results in improved exception handling. - //See https://github.com/dotnet/corefx/pull/29792/files#r189415885 for more details. if (await Task.WhenAny(tryConnectAsyncIPv6, tryConnectAsyncIPv4).ConfigureAwait(false) == tryConnectAsyncIPv6) { if (tryConnectAsyncIPv6.IsCompletedSuccessfully) |
