Skip to content

Conversation

@pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Mar 11, 2024

Fixes #98201
Fixes #98145


internal Task ConnectAsync(Uri uri, List<string>? requestedSubProtocols, CancellationToken cancellationToken)
{
AbortIfCancelationRequested(cancellationToken);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why moving it out of the lock?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably doesn't matter

{
Abort();
} // lock
cancellationToken.ThrowIfCancellationRequested();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi: this internally checks for 'cancellationToken.IsCancellationRequested`.

pavelsavara and others added 2 commits March 12, 2024 08:30
…ockets/BrowserWebSockets/BrowserWebSocket.cs

Co-authored-by: Ilona Tomkowicz <32700855+ilonatommy@users.noreply.github.com>
@pavelsavara pavelsavara merged commit 19d7768 into dotnet:main Mar 12, 2024
@pavelsavara pavelsavara deleted the browser_ws_cancelation branch March 12, 2024 13:57
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[browser][MT] HttpClientCancelTest.SendAsync_Cancel_Success [browser][MT] InvokerCancelTest.SendAsync_Cancel_Success

2 participants