Azure SignalR withAutomaticReconnect() "Error: Connection disconnected with error" on Angular8 & Asp.Net Core 3.1

Md. Najrul Islam 1 Reputation point
2020-05-25T02:40:52.723+00:00

hi there,

I am using Azure SignalR on Asp.Net Core 3.1 and Angular8. I also user withAutomaticReconnect() option on client side. It connect with azure signalr successfully. But after some times it show this error message and connected to the WebSocket again.

8691-signalrconnectionproblem2.png

Azure SignalR Service
Azure SignalR Service
An Azure service that is used for adding real-time communications to web applications.
120 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,831 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 25,476 Reputation points Microsoft Employee
    2020-05-28T22:13:48.387+00:00

    Hi @MdNajrullslam-2962,

    Make sure you double check that your KeepAliveInterval option is double the serverTimeoutInMilliseconds property. That property will ping the SignalR hub in order to have the connection remain open.

    public void ConfigureServices(IServiceCollection services)  
    {  
        services.AddSignalR(hubOptions =>  
        {  
            hubOptions.EnableDetailedErrors = true;  
            hubOptions.KeepAliveInterval = TimeSpan.FromMinutes(1);  
        });  
    }