AzureSignalR-samples icon indicating copy to clipboard operation
AzureSignalR-samples copied to clipboard

Connection to WebSocket disconnects no matter the timeout increases. (Azure SignalR)

Open charlesoto opened this issue 2 years ago • 2 comments

For both ASP.NET and ASP.NET Core SignalR, when connecting to an Azure SignalR service. If by any reason, the user loses connection to internet, and then sends a message while being offline, the Websocket will close returning a 1006 Close code. By the time the internet comes back (Approximately 7-15 seconds), the message is lost, and the user needs to re click the action in order to send the message again after the hub is reconnected.

I have tried to increate all time outs mentioned here:

https://learn.microsoft.com/en-us/aspnet/signalr/overview/guide-to-the-api/handling-connection-lifetime-events

and

https://learn.microsoft.com/en-us/aspnet/core/signalr/configuration?view=aspnetcore-8.0&tabs=dotnet

How to replicate this issue:

  1. Clone and run any of the samples in this source code (I ran ChatRoom)
  2. Entered the chat and send a first message
  3. Then disconnect the internet (Turn off wifi, disconnect cable, etc) and rapidly send another message.
  4. Wait at least 10 seconds
  5. Turn internet back on
  6. Websocket Close with error: image image

charlesoto avatar Nov 16 '23 23:11 charlesoto