SignalR: how to retrieve client information after recycling an application pool

At the time of connection, I map the client identifier to another client and the subscription information that I create in a static variable. This works fine until the application pool recycles or I recompile and then lose my mappings.

Client connections persist after reusing the application pool, but I do not see anything in the OnConnectAsync () or OnReceivedAsync () methods.

I see in Firebug that a new POST is sent by my clients every 4 minutes. Is there some SignalR event that I can override to capture the incoming POST and rebuild my client mapping for current persistent connections?

Thank.

+5
source share
1 answer

Make sure you are using SignalR 0.4. You can handle OnReconnectedAsync.

https://github.com/SignalR/SignalR/wiki/PersistentConnection

DISCLAIMER: If you save the state of your application in static variables, it will never be able to scale on the farm (but maybe you don't care).

+4
source

All Articles