Here is my problem, I want to track if user is online or offline and notify other clients about it. I\'m using hubs and implemented both IConnected and IDisconnect interface
There's not way to do this other than counting on your own.
Found how to workaround:
Rewrite ConnectionId
, so in every tab you'd have the same ConnectionId
:
public class MyConnectionFactory : IConnectionIdGenerator
{
public string GenerateConnectionId(IRequest request)
{
return MyUserManager.Instance.CurrentUserID.ToString();
}
}
Add to global.asax:
GlobalHost.DependencyResolver.Register(typeof(IConnectionIdGenerator), () => new MyConnectionFactory());
I managed to open as much tabs, as I could and all tabs get notifications.