1 write to Connection
Microsoft.AspNetCore.SignalR.Tests.Utils (1)
TestClient.cs (1)
46
Connection
= new DefaultConnectionContext(Guid.NewGuid().ToString(), pair.Transport, pair.Application);
98 references to Connection
Microsoft.AspNetCore.SignalR.Microbenchmarks (6)
RedisHubLifetimeManagerBenchmark.cs (6)
51
await _manager2.OnConnectedAsync(HubConnectionContextUtils.Create(client.
Connection
, protocol, userId));
52
await _manager2.AddToGroupAsync(client.
Connection
.ConnectionId, "Everyone");
53
await _manager2.AddToGroupAsync(client.
Connection
.ConnectionId, groupName);
70
_excludedConnectionIds.Add(_clients[i].
Connection
.ConnectionId);
76
_sendIds.Add(_clients[i].
Connection
.ConnectionId);
132
await _manager1.SendConnectionAsync(_clients[0].
Connection
.ConnectionId, "Test", _args);
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (4)
RedisHubLifetimeManagerTests.cs (4)
64
var connection1 = HubConnectionContextUtils.Create(client1.
Connection
);
65
var connection2 = HubConnectionContextUtils.Create(client2.
Connection
);
114
var connection = HubConnectionContextUtils.Create(client.
Connection
);
137
var connection = HubConnectionContextUtils.Create(client.
Connection
);
Microsoft.AspNetCore.SignalR.Tests (75)
DefaultHubLifetimeManagerTests.cs (14)
30
var connection1 = HubConnectionContextUtils.Create(client1.
Connection
);
31
var connection2 = HubConnectionContextUtils.Create(client2.
Connection
);
56
var connection1 = HubConnectionContextUtils.Create(client1.
Connection
);
57
var connection2 = HubConnectionContextUtils.Create(client2.
Connection
);
78
var connection1 = HubConnectionContextUtils.Create(client1.
Connection
);
96
var connection1 = HubConnectionContextUtils.Create(client1.
Connection
);
114
var connection1 = HubConnectionContextUtils.Create(client1.
Connection
);
134
var connection1 = HubConnectionContextUtils.Create(client1.
Connection
);
135
var connection2 = HubConnectionContextUtils.Create(client2.
Connection
);
158
var connection1 = HubConnectionContextUtils.Create(client1.
Connection
);
178
var connection1 = HubConnectionContextUtils.Create(client1.
Connection
, userIdentifier: "user");
179
var connection2 = HubConnectionContextUtils.Create(client2.
Connection
, userIdentifier: "user");
204
var connection1 = HubConnectionContextUtils.Create(client1.
Connection
, userIdentifier: "user1");
205
var connection2 = HubConnectionContextUtils.Create(client2.
Connection
, userIdentifier: "user2");
HubConnectionHandlerTests.Activity.cs (2)
561
client.
Connection
.LocalEndPoint = new IPEndPoint(IPAddress.Loopback, 5000);
562
client.
Connection
.RemoteEndPoint = new IPEndPoint(IPAddress.Parse("192.168.1.100"), 12345);
HubConnectionHandlerTests.ClientResult.cs (6)
116
client.
Connection
.Abort();
123
Assert.Equal($"Connection '{client.
Connection
.ConnectionId}' disconnected.", ex.Message);
146
var resultTask = context.Clients.Client(client.
Connection
.ConnectionId).InvokeAsync<int>("GetClientResult", 1, cancellationToken: default);
171
var connectionId = client.
Connection
.ConnectionId;
363
var connectionId = client.
Connection
.ConnectionId;
408
var connectionId = client.
Connection
.ConnectionId;
HubConnectionHandlerTests.cs (53)
134
var firedOnConnected = (bool)client.
Connection
.Items[nameof(ErrorInAbortedTokenHub.OnConnectedAsync)];
135
var firedOnDisconnected = (bool)client.
Connection
.Items[nameof(ErrorInAbortedTokenHub.OnDisconnectedAsync)];
354
await client.
Connection
.Application.Output.WriteAsync(part1);
358
await client.
Connection
.Application.Output.WriteAsync(part2);
362
await client.
Connection
.Application.Output.WriteAsync(part3);
395
await client.
Connection
.Application.Output.WriteAsync(part1);
399
await client.
Connection
.Application.Output.WriteAsync(part2);
403
await client.
Connection
.Application.Output.WriteAsync(part3);
436
await client.
Connection
.Application.Output.WriteAsync(payload);
491
await client.
Connection
.Application.Output.WriteAsync(payload);
520
await client.
Connection
.Application.Output.WriteAsync(payload.AsMemory(0, payload.Length / 2));
521
await client.
Connection
.Application.Output.WriteAsync(payload.AsMemory(payload.Length / 2));
554
client.
Connection
.Application.Output.Write(payload1);
555
client.
Connection
.Application.Output.Write(payload2);
556
client.
Connection
.Application.Output.Write(payload3);
557
await client.
Connection
.Application.Output.FlushAsync();
605
client.
Connection
.Application.Output.Write(payload1);
606
client.
Connection
.Application.Output.Write(payload2);
607
client.
Connection
.Application.Output.Write(payload3);
608
await client.
Connection
.Application.Output.FlushAsync();
669
await client.
Connection
.Application.Output.WriteAsync(payload).DefaultTimeout();
673
client.
Connection
.Application.Output.Complete();
962
client.
Connection
.Abort();
1566
excludeSecondClientId.Add(secondClient.
Connection
.ConnectionId);
1568
excludeThirdClientId.Add(thirdClient.
Connection
.ConnectionId);
1611
var secondAndThirdClients = new HashSet<string> {secondClient.
Connection
.ConnectionId,
1612
thirdClient.
Connection
.ConnectionId };
1757
var excludedConnectionIds = new List<string> { firstClient.
Connection
.ConnectionId };
1950
await firstClient.SendInvocationAsync("ConnectionSendMethod", secondClient.
Connection
.ConnectionId, "test").DefaultTimeout();
1983
await firstClient.SendInvocationAsync("DelayedSend", secondClient.
Connection
.ConnectionId, "test").DefaultTimeout();
2245
client.
Connection
.User.AddIdentity(new ClaimsIdentity(new[] { new Claim(ClaimTypes.NameIdentifier, "name") }));
2284
client.
Connection
.Features.Set<IConnectionLifetimeNotificationFeature>(new TestConnectionLifetimeNotification());
2290
client.
Connection
.Features.Get<IConnectionLifetimeNotificationFeature>().RequestClose();
2347
client.
Connection
.User.AddIdentity(new ClaimsIdentity(new[] { new Claim(ClaimTypes.NameIdentifier, "name") }));
2352
client.
Connection
.Features.Set<IHttpContextFeature>(httpConnectionContext);
2623
client.
Connection
.Features.Set<IHttpContextFeature>(feature);
2719
client.
Connection
.Transport.Output.Complete();
2765
client.
Connection
.Transport.Output.Complete();
3023
var customDuplex = new CustomDuplex(client.
Connection
.Transport);
3024
client.
Connection
.Transport = customDuplex;
3118
client.
Connection
.Transport.Output.Complete();
3566
await client.
Connection
.Application.Output.WriteAsync(Encoding.UTF8.GetBytes(new[] { '{' })).DefaultTimeout();
3569
client.
Connection
.Application.Output.Complete();
4583
var task = (Task<int>)client.
Connection
.Items[nameof(MethodHub.UploadDoesWorkOnComplete)];
5111
httpContext.Request.QueryString = new QueryString($"?client={client1.
Connection
.ConnectionId}");
5116
client2.
Connection
.Features.Set<IHttpContextFeature>(feature);
5223
client.
Connection
.Features.Set<IStatefulReconnectFeature>(new EmptyReconnectFeature());
5268
client.
Connection
.Features.Set<IStatefulReconnectFeature>(reconnectFeature);
5272
UpdateConnectionPair(client.
Connection
);
5274
await reconnectFeature.NotifyOnReconnect(client.
Connection
.Transport.Output);
5319
client1.
Connection
.Features.Set<IStatefulReconnectFeature>(reconnectFeature);
5348
client1.
Connection
.Abort();
5436
client.
Connection
.Features.Set<IStatefulReconnectFeature>(reconnectFeature);
Microsoft.AspNetCore.SignalR.Tests.Utils (13)
TestClient.cs (13)
34
public Task Connected => ((TaskCompletionSource)
Connection
.Items["ConnectedTask"]).Task;
49
Connection
.Features.Set<ITransferFormatFeature>(this);
50
Connection
.Features.Set<IConnectionHeartbeatFeature>(this);
59
Connection
.User = new ClaimsPrincipal(new ClaimsIdentity(claims));
60
Connection
.Items["ConnectedTask"] = new TaskCompletionSource();
75
await
Connection
.Application.Output.WriteAsync(GetHandshakeRequestMessage());
78
var connection = handler.OnConnectedAsync(
Connection
);
236
await
Connection
.Application.Output.WriteAsync(payload);
248
var result = await
Connection
.Application.Input.ReadAsync();
265
Connection
.Application.Input.AdvanceTo(buffer.Start);
277
if (!
Connection
.Application.Input.TryRead(out var result))
304
Connection
.Application.Input.AdvanceTo(buffer.Start);
314
Connection
.Application.Output.Complete();