Question

At connect time, I map the clientID to other client and subscription info which I build in a static variable. This works fine until the app pool recycles or I recompile and then I lose my mappings.

Client connections persist after the app pool recycle, but I am not seeing anything in either the OnConnectAsync() or OnReceivedAsync() methods.

I see in Firebug that a new POST is being submitted 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 the current persistent connections?

Thanks.

Was it helpful?

Solution

Make sure you're using SignalR 0.4. You can handle OnReconnectedAsync.

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

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top