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