Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[browser][websocket] Canceling token source before connect should throw OperationCanceledException #44720

Closed
kjpou1 opened this issue Nov 16, 2020 · 1 comment · Fixed by #44722
Assignees
Labels
arch-wasm WebAssembly architecture area-System.Net.Sockets
Milestone

Comments

@kjpou1
Copy link
Contributor

kjpou1 commented Nov 16, 2020

The WebSocketClient should throw an OperationCanceledException instead of trying to connect and then cancelling.

            using (var clientSocket = new ClientWebSocket())
            {
                var cts = new CancellationTokenSource();
                cts.Cancel();
                Task t = clientSocket.ConnectAsync(new Uri("ws://" + Guid.NewGuid().ToString("N")), cts.Token);
            }
@kjpou1 kjpou1 added arch-wasm WebAssembly architecture area-System.Net.Sockets labels Nov 16, 2020
@kjpou1 kjpou1 self-assigned this Nov 16, 2020
@ghost
Copy link

ghost commented Nov 16, 2020

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details
Description:

The WebSocketClient should throw an OperationCanceledException instead of trying to connect and then cancelling.

            using (var clientSocket = new ClientWebSocket())
            {
                var cts = new CancellationTokenSource();
                cts.Cancel();
                Task t = clientSocket.ConnectAsync(new Uri("ws://" + Guid.NewGuid().ToString("N")), cts.Token);
            }
        }
Author: kjpou1
Assignees: kjpou1
Labels:

arch-wasm, area-System.Net.Sockets

Milestone: -

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Nov 16, 2020
@kjpou1 kjpou1 removed the untriaged New issue has not been triaged by the area owner label Nov 16, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jan 8, 2021
@karelz karelz added this to the 6.0.0 milestone Jan 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-System.Net.Sockets
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants