Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ITransportHeartbeat.GetConnections() gets me disconnected connections

Tags:

signalr

In SignalR, the implementation of ITransportHeartbeat.GetConnections() should get me a list of connections being tracked. In one of my cases, I was always getting a web socket connection which didn't exist anymore.

Here is how I retrieve the default ITransportHeartbeat instance:

SignalRAutofac.Initialize();
IDependencyResolver resolver = GlobalHost.DependencyResolver;
ITransportHeartbeat heartbeat = resolver.Resolve<ITransportHeartbeat>();

I am assuming SignalR is sending heartbeat to the tracked connection in a specific interval. Is this the case? If yes, I didn't see that dead connection being dropped for 5 minutes from the list. Is this usual? is that dead connection supposed to live throughout the lifetime of the AppDomain?

like image 422
tugberk Avatar asked Jul 01 '13 10:07

tugberk


1 Answers

Check the IsAlive property on the retrieved connections.

like image 160
Dmitri M Avatar answered Oct 20 '22 21:10

Dmitri M