Exemple #1
0
 public async Task Send(AbstractHubMessage <THubMessage, TConnectionKey> message)
 {
     var messageJson   = message.ToJson();
     var connectionIds = _connections.GetConnections(message.To).ToList();
     await _hubContext.Clients.Clients(connectionIds).SendAsync("Receive", messageJson);
 }
Exemple #2
0
 public async Task Broadcast(AbstractHubMessage <THubMessage, TConnectionKey> message)
 {
     var messageJson = message.ToJson();
     await _hubContext.Clients.All.SendAsync("Receive", messageJson);
 }