I'm using ASP.net signalR. Windows application .Net

Pavithra 0 Reputation points
2025-11-26T16:17:34.7533333+00:00

After the client's network disconnects, the SignalR connection persists, but the client does not receive notifications. We make a request to the server, and the server responds, but the client still does not receive notifications even when a new request is created from the client after the network comes back up.
I'm using ASP.net signalR. Windows application .Net

Windows development | Windows App SDK
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-11-26T16:17:46.3466667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    In ASP.NET SignalR, if the client does not receive notifications after the network disconnects and reconnects, it may be due to the client not properly handling the reconnection process. When the network is restored, the SignalR client should attempt to reconnect automatically. If it does not, you may need to implement custom logic to handle reconnections and ensure that the client is notified of any messages or events after the connection is re-established.

    You can listen for the Closed event on the HubConnection to handle cases when the connection is lost. Additionally, you can configure automatic reconnect attempts using the WithAutomaticReconnect method to specify how the client should behave when the connection is interrupted. Here’s a basic example:

    connection.Closed += error =>
    {
        // Logic to handle connection closure
        // Attempt to reconnect or notify the user
    };
    
    HubConnection connection = new HubConnectionBuilder()
        .WithUrl(new Uri("http://yourserver/chathub"))
        .WithAutomaticReconnect()
        .Build();
    

    Make sure that your server is also set up to handle reconnections properly and that the client is subscribed to the necessary events to receive notifications after reconnecting. If the client is not receiving notifications after a new request is made, ensure that the hub methods are declared as public and that the client is correctly invoking these methods after the connection is restored.


    References:

    0 comments No comments

  2. Raymond Huynh (WICLOUD CORPORATION) 3,635 Reputation points Microsoft External Staff Moderator
    2025-11-27T10:08:51.45+00:00

    Hello Pavithra,

    Thanks for the extra details. When SignalR stops delivering messages after the network comes back, the usual cause is that the client reconnects but doesn’t fully restore its state.

    A few things worth checking on your side:

    (Disclaimer: Some links are non-Microsoft website. The pages appear to be providing accurate, safe information. Watch out for ads on the site that may advertise products frequently classifies as a PUP (Potentially Unwanted Products). Thoroughly research any product advertised on the site before you decide to download and install it.) 
    Hope this helps!


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.