Enable MA0040 and silence remaining case

"Flow the cancellation token"
This commit is contained in:
YoshiRulz 2024-07-04 05:48:35 +10:00
parent a7e1c8fd09
commit b818f5325a
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
2 changed files with 3 additions and 1 deletions

View File

@ -179,7 +179,7 @@ dotnet_diagnostic.MA0038.severity = silent
# Do not write your own certificate validation method
dotnet_diagnostic.MA0039.severity = error
# Flow the cancellation token
dotnet_diagnostic.MA0040.severity = silent
dotnet_diagnostic.MA0040.severity = error
# Make property static
dotnet_diagnostic.MA0041.severity = silent
# Do not use blocking calls in an async method

View File

@ -17,7 +17,9 @@ namespace BizHawk.Client.Common
public ClientWebSocketWrapper(Uri uri, CancellationToken? cancellationToken = null)
{
_w = new ClientWebSocket();
#pragma warning disable MA0040 // Analyzer not smart enough to recognise this
_w.ConnectAsync(uri, cancellationToken ?? CancellationToken.None).Wait();
#pragma warning restore MA0040
}
/// <summary>calls <see cref="ClientWebSocket.CloseAsync"/></summary>