Exemple #1
0
 private async Task NormalConnectionJoinGroup()
 {
     await SignalRUtils.JoinGroupForConnection(
         _totalConnection,
         _groupCount,
         _connectionIndex,
         async (i, g) =>
     {
         await SignalRUtils.JoinToGroup(
             _connections[i],
             SignalRUtils.GroupName(_type, g),
             _statisticsCollector);
     });
 }
 private async Task NormalConnectionJoinGroup()
 {
     if (_connections.Count >= _groupCount)
     {
         for (var i = 0; i < _connections.Count; i++)
         {
             await SignalRUtils.JoinToGroup(
                 _connections[i],
                 SignalRUtils.GroupName(_type, _connectionIndex[i] % _groupCount),
                 _statisticsCollector);
         }
     }
     else
     {
         var connectionCount = _connections.Count;
         for (var i = 0; i < _groupCount; i++)
         {
             await SignalRUtils.JoinToGroup(
                 _connections[i % connectionCount],
                 SignalRUtils.GroupName(_type, i),
                 _statisticsCollector);
         }
     }
 }