-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
DoneThis issue has been fixedThis issue has been fixedarea-signalrIncludes: SignalR clients and serversIncludes: SignalR clients and serversbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.
Milestone
Description
Seems that the AspNetCore Signalr Client doesn't respect the cancellationtoken passed into the StartAsync() method. It will throw appropriately if the CTS timeout is sufficiently short (e.g., 1 millisecond);
Using this version of ASP.NET Core 3 Preview 5
var cts = new CancellationTokenSource(TimeSpan.FromSeconds(1));
var _hubConnection = new HubConnectionBuilder()
.WithUrl(".WithUrl("http://slowwly.robertomurray.co.uk/delay/5000/url/http://www.google.co.uk")") //artificially slow, response times of ~5 seconds before a 404 is returned
.Build();
await _hubConnection.StartAsync(cts.Token);
Expected behavior
StartAsync() should throw an OperationCancelledException after 1 second. Any negotiation or handshake should be aborted if it was not already successfully completed within 1 second.
Current behavior
StartAsync() will wait until an HttpRequestException (in this case, a 404 after 5 seconds) is thrown or the connection succeeds. An OperationCancelledException is never thrown.
mark-szabo, BalintFarkas and navidmatin
Metadata
Metadata
Assignees
Labels
DoneThis issue has been fixedThis issue has been fixedarea-signalrIncludes: SignalR clients and serversIncludes: SignalR clients and serversbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.