73 references to ConnectionId
Microsoft.AspNetCore.SignalR.Core (11)
DefaultHubLifetimeManager.cs (5)
60_groups.Remove(connection.ConnectionId, groupName); 264DefaultHubLifetimeManager<THub>.SendToGroupConnections(methodName, args, group, (connection, state) => !((IReadOnlyList<string>)state!).Contains(connection.ConnectionId), excludedConnectionIds, ref tasks, ref message, cancellationToken); 306_groups.Remove(connection.ConnectionId, groupName); 318return SendToAllConnections(methodName, args, (connection, state) => !((IReadOnlyList<string>)state!).Contains(connection.ConnectionId), excludedConnectionIds, cancellationToken); 324return SendToAllConnections(methodName, args, (connection, state) => ((IReadOnlyList<string>)state!).Contains(connection.ConnectionId), connectionIds, cancellationToken);
HubConnectionStore.cs (2)
45_connections.TryAdd(connection.ConnectionId, connection); 54_connections.TryRemove(connection.ConnectionId, out _);
Internal\DefaultHubCallerContext.cs (1)
22public override string ConnectionId => _connection.ConnectionId;
Internal\DefaultHubDispatcher.cs (2)
215return _hubLifetimeManager.SetConnectionResultAsync(connection.ConnectionId, completionMessage); 660hub.Clients = new HubCallerClients(_hubContext.Clients, connection.ConnectionId, connection.ActiveInvocationLimit) { InvokeAllowed = invokeAllowed };
Internal\HubGroupList.cs (1)
70group.AddOrUpdate(connection.ConnectionId, connection, (_, __) => connection);
Microsoft.AspNetCore.SignalR.Specification.Tests (48)
HubLifetimeManagerTestBase.cs (21)
107await manager.AddToGroupAsync(connection1.ConnectionId, "group").DefaultTimeout(); 137await manager.AddToGroupAsync(connection1.ConnectionId, "group1").DefaultTimeout(); 138await manager.AddToGroupAsync(connection2.ConnectionId, "group1").DefaultTimeout(); 140await manager.SendGroupExceptAsync("group1", "Hello", new object[] { "World" }, new[] { connection2.ConnectionId }).DefaultTimeout(); 165await manager.SendConnectionAsync(connection.ConnectionId, "Hello", new object[] { "World" }).DefaultTimeout(); 189var resultTask = manager.InvokeConnectionAsync<int>(connection1.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default); 194await manager.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation.InvocationId, 10)).DefaultTimeout(); 216var resultTask = manager.InvokeConnectionAsync<int>(connection1.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default); 221await manager.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithError(invocation.InvocationId, "Error from client")).DefaultTimeout(); 246var resultTask = manager.InvokeConnectionAsync<int>(connection1.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default); 252manager.SetConnectionResultAsync(connection2.ConnectionId, CompletionMessage.WithError(invocation.InvocationId, "Error from client"))).DefaultTimeout(); 254Assert.Equal($"Connection ID '{connection2.ConnectionId}' is not valid for invocation ID '{invocation.InvocationId}'.", ex.Message); 257await manager.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation.InvocationId, 10)).DefaultTimeout(); 302var invoke1 = manager1.InvokeConnectionAsync<int>(connection1.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default); 303var invoke2 = manager1.InvokeConnectionAsync<int>(connection2.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default); 307await manager1.SetConnectionResultAsync(connection2.ConnectionId, CompletionMessage.WithError(invocation2.InvocationId, "error")); 312await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation1.InvocationId, 3)); 332var invoke1 = manager1.InvokeConnectionAsync<int>(connection1.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default); 338Assert.Equal($"Connection '{connection1.ConnectionId}' disconnected.", ex.Message); 358var invoke1 = manager1.InvokeConnectionAsync<int>(connection1.ConnectionId, "Result", new object[] { "test" }, cts.Token); 365await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation1.InvocationId, 1));
ScaleoutHubLifetimeManagerTests.cs (27)
113await manager2.SendConnectionAsync(connection.ConnectionId, "Hello", new object[] { "World" }).DefaultTimeout(); 137await manager1.AddToGroupAsync(connection.ConnectionId, "name").DefaultTimeout(); 161await manager.AddToGroupAsync(connection.ConnectionId, "name").DefaultTimeout(); 187await manager.RemoveFromGroupAsync(connection.ConnectionId, "name").DefaultTimeout(); 208await manager2.RemoveFromGroupAsync(connection.ConnectionId, "name").DefaultTimeout(); 229await manager2.AddToGroupAsync(connection.ConnectionId, "name").DefaultTimeout(); 253await manager.AddToGroupAsync(connection.ConnectionId, "name").DefaultTimeout(); 254await manager.AddToGroupAsync(connection.ConnectionId, "name").DefaultTimeout(); 280await manager1.AddToGroupAsync(connection.ConnectionId, "name").DefaultTimeout(); 281await manager2.AddToGroupAsync(connection.ConnectionId, "name").DefaultTimeout(); 307await manager1.AddToGroupAsync(connection.ConnectionId, "name").DefaultTimeout(); 313await manager2.RemoveFromGroupAsync(connection.ConnectionId, "name").DefaultTimeout(); 340await manager1.SendConnectionAsync(connection.ConnectionId, "Hello", new object[] { "World" }).DefaultTimeout(); 367await manager1.SendConnectionAsync(connectionMock.ConnectionId, "Hello", new object[] { "World" }).DefaultTimeout(); 391await manager.AddToGroupAsync(connection1.ConnectionId, "group"); 393await manager.AddToGroupAsync(connection2.ConnectionId, "group"); 485var resultTask = manager2.InvokeConnectionAsync<int>(connection1.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default); 491await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation.InvocationId, 10)).DefaultTimeout(); 516var resultTask = manager2.InvokeConnectionAsync<int>(connection1.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default); 522await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithError(invocation.InvocationId, "Error from client")).DefaultTimeout(); 568var invoke1 = manager1.InvokeConnectionAsync<int>(connection1.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default); 597var invoke1 = manager1.InvokeConnectionAsync<int>(connection.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default); 600var invoke2 = manager2.InvokeConnectionAsync<int>(connection.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default); 605await manager1.SetConnectionResultAsync(connection.ConnectionId, CompletionMessage.WithResult(invocation2.InvocationId, 2)).DefaultTimeout(); 606await manager2.SetConnectionResultAsync(connection.ConnectionId, CompletionMessage.WithResult(invocation1.InvocationId, 5)).DefaultTimeout(); 648var resultTask = manager2.InvokeConnectionAsync<int>(connection1.ConnectionId, "Result", new object[] { "test" }, cancellationToken: default); 654await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation.InvocationId, "wrong type")).DefaultTimeout();
Microsoft.AspNetCore.SignalR.StackExchangeRedis (5)
RedisHubLifetimeManager.cs (5)
123var connectionChannel = _channels.Connection(connection.ConnectionId); 465if (invocation.ExcludedConnectionIds == null || !invocation.ExcludedConnectionIds.Contains(connection.ConnectionId)) 530var connectionChannel = _channels.Connection(connection.ConnectionId); 543(typeof(RawResult), connection.ConnectionId, null!, async (_, completionMessage) => 626if (invocation.ExcludedConnectionIds?.Contains(groupConnection.ConnectionId) == true)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
RedisHubLifetimeManagerTests.cs (1)
144await manager.AddToGroupAsync(connection.ConnectionId, groupName).DefaultTimeout();
Microsoft.AspNetCore.SignalR.Tests (8)
DefaultHubLifetimeManagerTests.cs (8)
65var sendTask = manager.SendAllExceptAsync("Hello", new object[] { "World" }, new List<string> { connection1.ConnectionId }, cts.Token).DefaultTimeout(); 89var sendTask = manager.SendConnectionAsync(connection1.ConnectionId, "Hello", new object[] { "World" }, cts.Token).DefaultTimeout(); 111var sendTask = manager.SendConnectionsAsync(new List<string> { connection1.ConnectionId }, "Hello", new object[] { "World" }, cts.Token).DefaultTimeout(); 132await manager.AddToGroupAsync(connection1.ConnectionId, "group").DefaultTimeout(); 158await manager.AddToGroupAsync(connection1.ConnectionId, "group").DefaultTimeout(); 159await manager.AddToGroupAsync(connection2.ConnectionId, "group").DefaultTimeout(); 161var sendTask = manager.SendGroupExceptAsync("group", "Hello", new object[] { "World" }, new List<string> { connection1.ConnectionId }, cts.Token).DefaultTimeout(); 184await manager.AddToGroupAsync(connection1.ConnectionId, "group").DefaultTimeout();