123456789101112131415161718192021222324252627 |
- using System.Threading.Tasks;
- using Microsoft.AspNetCore.SignalR;
-
- namespace Luticate2.Utils.Hubs
- {
- public class LuHub : Hub
- {
- private readonly LuHubConnectionTracker _connectionTracker;
-
- public LuHub(LuHubConnectionTracker connectionTracker)
- {
- _connectionTracker = connectionTracker;
- }
-
- public override Task OnConnected()
- {
- _connectionTracker.Add(this, Context.ConnectionId);
- return base.OnConnected();
- }
-
- public override Task OnDisconnected(bool stopCalled)
- {
- _connectionTracker.Remove(this, Context.ConnectionId);
- return base.OnDisconnected(stopCalled);
- }
- }
- }
|