Skip to content

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

Closed

Description

@kjpou1

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);
            }

Activity

  1. self-assigned this
    on Nov 16, 2020
  2. added
    untriaged
    on Nov 16, 2020
  3. removed
    untriaged
    on Nov 16, 2020
  4. ghost locked as resolved and limited conversation to collaborators on Jan 8, 2021
  5. added this to the 6.0.0 milestone on Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

arch-wasmarea-System.Net.Sockets

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions