Skip to content

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

@charlesoto

Description

@charlesoto

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions