1 instantiation of HubConnectionContext
Microsoft.AspNetCore.SignalR.Core (1)
HubConnectionHandler.cs (1)
134
var connectionContext = new
HubConnectionContext
(connection, contextOptions, _loggerFactory)
80 references to HubConnectionContext
Microsoft.AspNetCore.SignalR (1)
GetHttpContextExtensions.cs (1)
30
public static HttpContext? GetHttpContext(this
HubConnectionContext
connection)
Microsoft.AspNetCore.SignalR.Core (79)
DefaultHubLifetimeManager.cs (10)
39
var
connection = _connections[connectionId];
72
var
connection = _connections[connectionId];
99
private Task SendToAllConnections(string methodName, object?[] args, Func<
HubConnectionContext
, object?, bool>? include, object? state = null, CancellationToken cancellationToken = default)
105
foreach (
var
connection in _connections)
147
private static void SendToGroupConnections(string methodName, object?[] args, ConcurrentDictionary<string,
HubConnectionContext
> connections, Func<
HubConnectionContext
, object?, bool>? include, object? state, ref List<Task>? tasks, ref SerializedHubMessage? message, CancellationToken cancellationToken)
187
var
connection = _connections[connectionId];
292
public override Task OnConnectedAsync(
HubConnectionContext
connection)
299
public override Task OnDisconnectedAsync(
HubConnectionContext
connection)
338
var
connection = _connections[connectionId];
DefaultUserIdProvider.cs (2)
10
/// This provider gets the user ID from the connection's <see cref="
HubConnectionContext
.User"/> name identifier claim.
15
public virtual string? GetUserId(
HubConnectionContext
connection)
HubConnectionContext.cs (11)
65
/// Initializes a new instance of the <see cref="
HubConnectionContext
"/> class.
80
_logger = loggerFactory.CreateLogger(typeof(
HubConnectionContext
));
82
_closedRegistration = connectionContext.ConnectionClosed.Register(static (state) => ((
HubConnectionContext
)state!).Abort(), this);
87
_closedRequestedRegistration = lifetimeNotification.ConnectionClosedRequested.Register(static (state) => ((
HubConnectionContext
)state!).AbortAllowReconnect(), this);
276
static async ValueTask<FlushResult> WriteAsync(MessageBuffer messageBuffer,
HubConnectionContext
hubConnectionContext,
323
static async ValueTask<FlushResult> WriteAsync(MessageBuffer messageBuffer,
HubConnectionContext
hubConnectionContext,
621
Features.Get<IConnectionHeartbeatFeature>()?.OnHeartbeat(state => ((
HubConnectionContext
)state).KeepAliveTick(), this);
738
Features.Get<IConnectionHeartbeatFeature>()?.OnHeartbeat(state => ((
HubConnectionContext
)state).CheckClientTimeout(), this);
766
var
connection = (
HubConnectionContext
)state!;
781
static async Task InnerAbortConnection(
HubConnectionContext
connection)
HubConnectionContextOptions.cs (1)
7
/// Options used to configure <see cref="
HubConnectionContext
"/>.
HubConnectionHandler.cs (5)
134
var
connectionContext = new HubConnectionContext(connection, contextOptions, _loggerFactory)
161
private async Task RunHubAsync(
HubConnectionContext
connection)
200
private async Task HubOnDisconnectedAsync(
HubConnectionContext
connection, Exception? exception)
239
private async Task SendCloseAsync(
HubConnectionContext
connection, Exception? exception, bool allowReconnect)
263
private async Task DispatchMessagesAsync(
HubConnectionContext
connection)
HubConnectionStore.cs (13)
10
/// Stores <see cref="
HubConnectionContext
"/>s by ID.
17
private readonly ConcurrentDictionary<string,
HubConnectionContext
> _connections =
18
new ConcurrentDictionary<string,
HubConnectionContext
>(StringComparer.Ordinal);
21
/// Get the <see cref="
HubConnectionContext
"/> by connection ID.
25
public
HubConnectionContext
? this[string connectionId]
29
_connections.TryGetValue(connectionId, out
var
connection);
40
/// Add a <see cref="
HubConnectionContext
"/> to the store.
43
public void Add(
HubConnectionContext
connection)
49
/// Removes a <see cref="
HubConnectionContext
"/> from the store.
52
public void Remove(
HubConnectionContext
connection)
69
public readonly struct Enumerator : IEnumerator<
HubConnectionContext
>
71
private readonly IEnumerator<KeyValuePair<string,
HubConnectionContext
>> _enumerator;
85
public
HubConnectionContext
Current => _enumerator.Current.Value;
HubLifetimeManager.cs (2)
20
public abstract Task OnConnectedAsync(
HubConnectionContext
connection);
28
public abstract Task OnDisconnectedAsync(
HubConnectionContext
connection);
Internal\DefaultHubCallerContext.cs (2)
14
private readonly
HubConnectionContext
_connection;
16
public DefaultHubCallerContext(
HubConnectionContext
connection)
Internal\DefaultHubDispatcher.cs (18)
83
public override async Task OnConnectedAsync(
HubConnectionContext
connection)
119
public override async Task OnDisconnectedAsync(
HubConnectionContext
connection, Exception? exception)
154
public override Task DispatchMessageAsync(
HubConnectionContext
connection, HubMessage hubMessage)
245
private Task ProcessInvocationBindingFailure(
HubConnectionContext
connection, InvocationBindingFailureMessage bindingFailureMessage)
254
private Task ProcessStreamBindingFailure(
HubConnectionContext
connection, StreamBindingFailureMessage bindingFailureMessage)
270
private Task ProcessStreamItem(
HubConnectionContext
connection, StreamItemMessage message)
282
private Task ProcessInvocation(
HubConnectionContext
connection,
318
private async Task<bool> Invoke(HubMethodDescriptor descriptor,
HubConnectionContext
connection,
391
HubConnectionContext
connection,
492
private static ValueTask CleanupInvocation(
HubConnectionContext
connection, HubMethodInvocationMessage hubMessage, IHubActivator<THub>? hubActivator,
511
private async Task StreamAsync(string invocationId,
HubConnectionContext
connection, object?[] arguments, AsyncServiceScope scope,
606
private ValueTask<object?> ExecuteHubMethod(ObjectMethodExecutor methodExecutor, THub hub, object?[] arguments,
HubConnectionContext
connection, IServiceProvider serviceProvider)
648
private static async Task SendInvocationError(string? invocationId,
HubConnectionContext
connection, string errorMessage)
658
private void InitializeHub(THub hub,
HubConnectionContext
connection, bool invokeAllowed = true)
665
private static Task<bool> IsHubMethodAuthorized(IServiceProvider provider,
HubConnectionContext
hubConnectionContext, HubMethodDescriptor descriptor, object?[] hubMethodArguments, Hub hub)
691
HubMethodInvocationMessage hubMethodInvocationMessage,
HubConnectionContext
connection)
719
HubConnectionContext
connection, AsyncServiceScope scope, ref object?[] arguments, out CancellationTokenSource? cts)
832
private static Activity? StartActivity(string operationName, ActivityKind kind, Activity? linkedActivity, IServiceProvider serviceProvider, string methodName, IDictionary<string, string>? headers, ILogger logger,
HubConnectionContext
? connection = null)
Internal\HubConnectionBinder.cs (2)
11
private readonly
HubConnectionContext
_connection;
14
public HubConnectionBinder(HubDispatcher<THub> dispatcher, HubLifetimeManager<THub> lifetimeManager,
HubConnectionContext
connection)
Internal\HubDispatcher.cs (3)
11
public abstract Task OnConnectedAsync(
HubConnectionContext
connection);
12
public abstract Task OnDisconnectedAsync(
HubConnectionContext
connection, Exception? exception);
13
public abstract Task DispatchMessageAsync(
HubConnectionContext
connection, HubMessage hubMessage);
Internal\HubGroupList.cs (9)
9
internal sealed class HubGroupList : IReadOnlyCollection<ConcurrentDictionary<string,
HubConnectionContext
>>
16
public ConcurrentDictionary<string,
HubConnectionContext
>? this[string groupName]
25
public void Add(
HubConnectionContext
connection, string groupName)
34
if (connections.TryRemove(connectionId, out
var
_) && connections.IsEmpty)
47
public IEnumerator<ConcurrentDictionary<string,
HubConnectionContext
>> GetEnumerator()
57
private void CreateOrUpdateGroupWithConnection(string groupName,
HubConnectionContext
connection)
68
HubConnectionContext
connection, GroupConnectionList group)
75
internal sealed class GroupConnectionList : ConcurrentDictionary<string,
HubConnectionContext
>
79
if (obj is ConcurrentDictionary<string,
HubConnectionContext
> list)
IUserIdProvider.cs (1)
17
string? GetUserId(
HubConnectionContext
connection);