432 references to HubConnection
ClientSample (7)
HubSample.cs (2)
57
var
connection = connectionBuilder.Build();
126
private static async Task<bool> ConnectAsync(
HubConnection
connection, CancellationToken token)
StreamingSample.cs (1)
27
var
connection = new HubConnectionBuilder()
UploadSample.cs (4)
30
var
connection = new HubConnectionBuilder()
42
public static async Task BasicInvoke(
HubConnection
connection)
58
public static async Task ScoreTrackerExample(
HubConnection
connection)
83
public static async Task StreamingEcho(
HubConnection
connection)
JwtClientSample (1)
Program.cs (1)
31
var
hubConnection = new HubConnectionBuilder()
Microsoft.AspNetCore.SignalR.Client (8)
HubConnectionBuilderHttpExtensions.cs (8)
35
/// Configures the <see cref="
HubConnection
" /> to use HTTP-based transports to connect to the specified URL.
47
/// Configures the <see cref="
HubConnection
" /> to use HTTP-based transports to connect to the specified URL.
60
/// Configures the <see cref="
HubConnection
" /> to use HTTP-based transports to connect to the specified URL and transports.
73
/// Configures the <see cref="
HubConnection
" /> to use HTTP-based transports to connect to the specified URL and transports.
87
/// Configures the <see cref="
HubConnection
" /> to use HTTP-based transports to connect to the specified URL.
99
/// Configures the <see cref="
HubConnection
" /> to use HTTP-based transports to connect to the specified URL.
112
/// Configures the <see cref="
HubConnection
" /> to use HTTP-based transports to connect to the specified URL and transports.
125
/// Configures the <see cref="
HubConnection
" /> to use HTTP-based transports to connect to the specified URL and transports.
Microsoft.AspNetCore.SignalR.Client.Core (153)
HubConnection.cs (18)
38
/// A <see cref="
HubConnection
"/> should be created using <see cref="HubConnectionBuilder"/>.
71
private static readonly MethodInfo _sendStreamItemsMethod = typeof(
HubConnection
).GetMethods(BindingFlags.NonPublic | BindingFlags.Instance).Single(m => m.Name.Equals(nameof(SendStreamItems)));
72
private static readonly MethodInfo _sendIAsyncStreamItemsMethod = typeof(
HubConnection
).GetMethods(BindingFlags.NonPublic | BindingFlags.Instance).Single(m => m.Name.Equals(nameof(SendIAsyncEnumerableStreamItems)));
122
/// Occurs when the <see cref="
HubConnection
"/> starts reconnecting after losing its underlying connection.
140
/// Occurs when the <see cref="
HubConnection
"/> successfully reconnects after losing its underlying connection.
143
/// The <see cref="string"/> parameter will be the <see cref="
HubConnection
"/>'s new ConnectionId or null if negotiation was skipped.
189
/// Indicates the state of the <see cref="
HubConnection
"/> to the server.
194
/// Initializes a new instance of the <see cref="
HubConnection
"/> class.
199
/// <param name="serviceProvider">An <see cref="IServiceProvider"/> containing the services provided to this <see cref="
HubConnection
"/> instance.</param>
203
/// The <see cref="
HubConnection
"/> will not reconnect if the <paramref name="reconnectPolicy"/> is null.
215
/// Initializes a new instance of the <see cref="
HubConnection
"/> class.
220
/// <param name="serviceProvider">An <see cref="IServiceProvider"/> containing the services provided to this <see cref="
HubConnection
"/> instance.</param>
237
_logger = _loggerFactory.CreateLogger(typeof(
HubConnection
));
274
throw new InvalidOperationException($"The {nameof(
HubConnection
)} cannot be started if it is not in the {nameof(HubConnectionState.Disconnected)} state.");
281
throw new InvalidOperationException($"The {nameof(
HubConnection
)} cannot be started while {nameof(StopAsync)} is running.");
323
/// Disposes the <see cref="
HubConnection
"/>.
2114
private readonly
HubConnection
_hubConnection;
2147
public ConnectionState(ConnectionContext connection,
HubConnection
hubConnection)
HubConnectionBuilder.cs (6)
15
/// A builder for configuring <see cref="
HubConnection
"/> instances.
30
Services.AddSingleton<
HubConnection
>();
36
public
HubConnection
Build()
50
throw new InvalidOperationException($"Cannot create {nameof(
HubConnection
)} instance. An {nameof(IConnectionFactory)} was not configured.");
53
throw new InvalidOperationException($"Cannot create {nameof(
HubConnection
)} instance. An {nameof(EndPoint)} was not configured.");
55
return serviceProvider.GetRequiredService<
HubConnection
>();
HubConnectionBuilderExtensions.cs (7)
29
/// Configures the <see cref="
HubConnection
"/> to automatically attempt to reconnect if the connection is lost.
41
/// Configures the <see cref="
HubConnection
"/> to automatically attempt to reconnect if the connection is lost.
56
/// Configures the <see cref="
HubConnection
"/> to automatically attempt to reconnect if the connection is lost.
68
/// Configures ServerTimeout for the <see cref="
HubConnection
" />.
71
/// <param name="timeout">ServerTimeout for the <see cref="
HubConnection
"/>.</param>
80
/// Configures KeepAliveInterval for the <see cref="
HubConnection
" />.
83
/// <param name="interval">KeepAliveInterval for the <see cref="
HubConnection
"/>.</param>
HubConnectionExtensions.cs (21)
11
/// Extension methods for <see cref="
HubConnection
"/>.
15
private static IDisposable On(this
HubConnection
hubConnection, string methodName, Type[] parameterTypes, Action<object?[]> handler)
32
public static IDisposable On(this
HubConnection
hubConnection, string methodName, Action handler)
47
public static IDisposable On<T1>(this
HubConnection
hubConnection, string methodName, Action<T1> handler)
65
public static IDisposable On<T1, T2>(this
HubConnection
hubConnection, string methodName, Action<T1, T2> handler)
84
public static IDisposable On<T1, T2, T3>(this
HubConnection
hubConnection, string methodName, Action<T1, T2, T3> handler)
104
public static IDisposable On<T1, T2, T3, T4>(this
HubConnection
hubConnection, string methodName, Action<T1, T2, T3, T4> handler)
125
public static IDisposable On<T1, T2, T3, T4, T5>(this
HubConnection
hubConnection, string methodName, Action<T1, T2, T3, T4, T5> handler)
147
public static IDisposable On<T1, T2, T3, T4, T5, T6>(this
HubConnection
hubConnection, string methodName, Action<T1, T2, T3, T4, T5, T6> handler)
170
public static IDisposable On<T1, T2, T3, T4, T5, T6, T7>(this
HubConnection
hubConnection, string methodName, Action<T1, T2, T3, T4, T5, T6, T7> handler)
194
public static IDisposable On<T1, T2, T3, T4, T5, T6, T7, T8>(this
HubConnection
hubConnection, string methodName, Action<T1, T2, T3, T4, T5, T6, T7, T8> handler)
211
public static IDisposable On(this
HubConnection
hubConnection, string methodName, Type[] parameterTypes, Func<object?[], Task> handler)
227
public static IDisposable On(this
HubConnection
hubConnection, string methodName, Func<Task> handler)
242
public static IDisposable On<T1>(this
HubConnection
hubConnection, string methodName, Func<T1, Task> handler)
260
public static IDisposable On<T1, T2>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, Task> handler)
279
public static IDisposable On<T1, T2, T3>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, T3, Task> handler)
299
public static IDisposable On<T1, T2, T3, T4>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, T3, T4, Task> handler)
320
public static IDisposable On<T1, T2, T3, T4, T5>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, T3, T4, T5, Task> handler)
342
public static IDisposable On<T1, T2, T3, T4, T5, T6>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, T3, T4, T5, T6, Task> handler)
365
public static IDisposable On<T1, T2, T3, T4, T5, T6, T7>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, T3, T4, T5, T6, T7, Task> handler)
389
public static IDisposable On<T1, T2, T3, T4, T5, T6, T7, T8>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, T3, T4, T5, T6, T7, T8, Task> handler)
HubConnectionExtensions.InvokeAsync.cs (13)
13
/// Extension methods for <see cref="
HubConnection
"/>.
25
public static Task InvokeAsync(this
HubConnection
hubConnection, string methodName, CancellationToken cancellationToken = default)
39
public static Task InvokeAsync(this
HubConnection
hubConnection, string methodName, object? arg1, CancellationToken cancellationToken = default)
54
public static Task InvokeAsync(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, CancellationToken cancellationToken = default)
70
public static Task InvokeAsync(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, CancellationToken cancellationToken = default)
87
public static Task InvokeAsync(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, CancellationToken cancellationToken = default)
105
public static Task InvokeAsync(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, CancellationToken cancellationToken = default)
124
public static Task InvokeAsync(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, CancellationToken cancellationToken = default)
144
public static Task InvokeAsync(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, CancellationToken cancellationToken = default)
165
public static Task InvokeAsync(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, CancellationToken cancellationToken = default)
187
public static Task InvokeAsync(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, CancellationToken cancellationToken = default)
210
public static Task InvokeAsync(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, CancellationToken cancellationToken = default)
223
public static Task InvokeCoreAsync(this
HubConnection
hubConnection, string methodName, object?[] args, CancellationToken cancellationToken = default)
HubConnectionExtensions.InvokeAsyncGeneric.cs (13)
13
/// Extension methods for <see cref="
HubConnection
"/>.
29
public static Task<TResult> InvokeAsync<TResult>(this
HubConnection
hubConnection, string methodName, CancellationToken cancellationToken = default)
47
public static Task<TResult> InvokeAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, CancellationToken cancellationToken = default)
66
public static Task<TResult> InvokeAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, CancellationToken cancellationToken = default)
86
public static Task<TResult> InvokeAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, CancellationToken cancellationToken = default)
107
public static Task<TResult> InvokeAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, CancellationToken cancellationToken = default)
129
public static Task<TResult> InvokeAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, CancellationToken cancellationToken = default)
152
public static Task<TResult> InvokeAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, CancellationToken cancellationToken = default)
176
public static Task<TResult> InvokeAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, CancellationToken cancellationToken = default)
201
public static Task<TResult> InvokeAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, CancellationToken cancellationToken = default)
227
public static Task<TResult> InvokeAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, CancellationToken cancellationToken = default)
254
public static Task<TResult> InvokeAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, CancellationToken cancellationToken = default)
271
public static async Task<TResult> InvokeCoreAsync<TResult>(this
HubConnection
hubConnection, string methodName, object?[] args, CancellationToken cancellationToken = default)
HubConnectionExtensions.OnResult.cs (21)
14
/// Extension methods for <see cref="
HubConnection
"/>.
18
private static IDisposable On<TResult>(this
HubConnection
hubConnection, string methodName, Type[] parameterTypes, Func<object?[], TResult> handler)
37
public static IDisposable On<TResult>(this
HubConnection
hubConnection, string methodName, Type[] parameterTypes, Func<object?[], Task<TResult>> handler)
55
public static IDisposable On<TResult>(this
HubConnection
hubConnection, string methodName, Func<Task<TResult>> handler)
71
public static IDisposable On<TResult>(this
HubConnection
hubConnection, string methodName, Func<TResult> handler)
88
public static IDisposable On<T1, TResult>(this
HubConnection
hubConnection, string methodName, Func<T1, TResult> handler)
108
public static IDisposable On<T1, T2, TResult>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, TResult> handler)
129
public static IDisposable On<T1, T2, T3, TResult>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, T3, TResult> handler)
151
public static IDisposable On<T1, T2, T3, T4, TResult>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, T3, T4, TResult> handler)
174
public static IDisposable On<T1, T2, T3, T4, T5, TResult>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, T3, T4, T5, TResult> handler)
198
public static IDisposable On<T1, T2, T3, T4, T5, T6, TResult>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, T3, T4, T5, T6, TResult> handler)
223
public static IDisposable On<T1, T2, T3, T4, T5, T6, T7, TResult>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, T3, T4, T5, T6, T7, TResult> handler)
249
public static IDisposable On<T1, T2, T3, T4, T5, T6, T7, T8, TResult>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult> handler)
268
public static IDisposable On<T1, TResult>(this
HubConnection
hubConnection, string methodName, Func<T1, Task<TResult>> handler)
288
public static IDisposable On<T1, T2, TResult>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, Task<TResult>> handler)
309
public static IDisposable On<T1, T2, T3, TResult>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, T3, Task<TResult>> handler)
331
public static IDisposable On<T1, T2, T3, T4, TResult>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, T3, T4, Task<TResult>> handler)
354
public static IDisposable On<T1, T2, T3, T4, T5, TResult>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, T3, T4, T5, Task<TResult>> handler)
378
public static IDisposable On<T1, T2, T3, T4, T5, T6, TResult>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, T3, T4, T5, T6, Task<TResult>> handler)
403
public static IDisposable On<T1, T2, T3, T4, T5, T6, T7, TResult>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, T3, T4, T5, T6, T7, Task<TResult>> handler)
429
public static IDisposable On<T1, T2, T3, T4, T5, T6, T7, T8, TResult>(this
HubConnection
hubConnection, string methodName, Func<T1, T2, T3, T4, T5, T6, T7, T8, Task<TResult>> handler)
HubConnectionExtensions.SendAsync.cs (12)
12
/// Extension methods for <see cref="
HubConnection
"/>.
25
public static Task SendAsync(this
HubConnection
hubConnection, string methodName, CancellationToken cancellationToken = default)
40
public static Task SendAsync(this
HubConnection
hubConnection, string methodName, object? arg1, CancellationToken cancellationToken = default)
56
public static Task SendAsync(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, CancellationToken cancellationToken = default)
73
public static Task SendAsync(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, CancellationToken cancellationToken = default)
91
public static Task SendAsync(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, CancellationToken cancellationToken = default)
110
public static Task SendAsync(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, CancellationToken cancellationToken = default)
130
public static Task SendAsync(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, CancellationToken cancellationToken = default)
151
public static Task SendAsync(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, CancellationToken cancellationToken = default)
173
public static Task SendAsync(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, CancellationToken cancellationToken = default)
196
public static Task SendAsync(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, CancellationToken cancellationToken = default)
220
public static Task SendAsync(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, CancellationToken cancellationToken = default)
HubConnectionExtensions.StreamAsChannelAsync.cs (13)
14
/// Extension methods for <see cref="
HubConnection
"/>.
30
public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this
HubConnection
hubConnection, string methodName, CancellationToken cancellationToken = default)
48
public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, CancellationToken cancellationToken = default)
67
public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, CancellationToken cancellationToken = default)
87
public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, CancellationToken cancellationToken = default)
108
public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, CancellationToken cancellationToken = default)
130
public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, CancellationToken cancellationToken = default)
153
public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, CancellationToken cancellationToken = default)
177
public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, CancellationToken cancellationToken = default)
202
public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, CancellationToken cancellationToken = default)
228
public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, CancellationToken cancellationToken = default)
255
public static Task<ChannelReader<TResult>> StreamAsChannelAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, CancellationToken cancellationToken = default)
272
public static async Task<ChannelReader<TResult>> StreamAsChannelCoreAsync<TResult>(this
HubConnection
hubConnection, string methodName, object?[] args, CancellationToken cancellationToken = default)
HubConnectionExtensions.StreamAsync.cs (12)
12
/// Extension methods for <see cref="
HubConnection
"/>.
27
public static IAsyncEnumerable<TResult> StreamAsync<TResult>(this
HubConnection
hubConnection, string methodName, CancellationToken cancellationToken = default)
44
public static IAsyncEnumerable<TResult> StreamAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, CancellationToken cancellationToken = default)
62
public static IAsyncEnumerable<TResult> StreamAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, CancellationToken cancellationToken = default)
81
public static IAsyncEnumerable<TResult> StreamAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, CancellationToken cancellationToken = default)
101
public static IAsyncEnumerable<TResult> StreamAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, CancellationToken cancellationToken = default)
122
public static IAsyncEnumerable<TResult> StreamAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, CancellationToken cancellationToken = default)
144
public static IAsyncEnumerable<TResult> StreamAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, CancellationToken cancellationToken = default)
167
public static IAsyncEnumerable<TResult> StreamAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, CancellationToken cancellationToken = default)
191
public static IAsyncEnumerable<TResult> StreamAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, CancellationToken cancellationToken = default)
216
public static IAsyncEnumerable<TResult> StreamAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, CancellationToken cancellationToken = default)
242
public static IAsyncEnumerable<TResult> StreamAsync<TResult>(this
HubConnection
hubConnection, string methodName, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8, object? arg9, object? arg10, CancellationToken cancellationToken = default)
HubConnectionOptions.cs (6)
13
/// Configures options for the <see cref="
HubConnection
" />.
18
/// Configures ServerTimeout for the <see cref="
HubConnection
" />.
20
public TimeSpan ServerTimeout { get; set; } =
HubConnection
.DefaultServerTimeout;
23
/// Configures KeepAliveInterval for the <see cref="
HubConnection
" />.
25
public TimeSpan KeepAliveInterval { get; set; } =
HubConnection
.DefaultKeepAliveInterval;
31
public long StatefulReconnectBufferSize { get; set; } =
HubConnection
.DefaultStatefulReconnectBufferSize;
HubConnectionState.cs (1)
7
/// Describes the current state of the <see cref="
HubConnection
"/> to the server.
IHubConnectionBuilder.cs (4)
7
/// A builder abstraction for configuring <see cref="
HubConnection
"/> instances.
12
/// Creates a <see cref="
HubConnection
"/>.
15
/// A <see cref="
HubConnection
"/> built using the configured options.
17
HubConnection
Build();
Internal\InvocationRequest.cs (6)
25
public
HubConnection
HubConnection { get; }
28
protected InvocationRequest(CancellationToken cancellationToken, Type resultType, string invocationId, ILogger logger,
HubConnection
hubConnection, Activity? activity)
48
public static InvocationRequest Invoke(CancellationToken cancellationToken, Type resultType, string invocationId, ILoggerFactory loggerFactory,
HubConnection
hubConnection, Activity? activity, out Task<object?> result)
56
ILoggerFactory loggerFactory,
HubConnection
hubConnection, Activity? activity, out ChannelReader<object?> result)
83
public Streaming(CancellationToken cancellationToken, Type resultType, string invocationId, ILoggerFactory loggerFactory,
HubConnection
hubConnection, Activity? activity)
171
public NonStreaming(CancellationToken cancellationToken, Type resultType, string invocationId, ILoggerFactory loggerFactory,
HubConnection
hubConnection, Activity? activity)
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (91)
HubConnectionTests.cs (75)
34
private
HubConnection
CreateHubConnection(
100
var
connection = connectionBuilder.Build();
139
var
connection = connectionBuilder.Build();
169
var
connection = connectionBuilder.Build();
195
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
223
var
connection = CreateHubConnection(server.Url, "/default", HttpTransportType.LongPolling, protocol, LoggerFactory);
253
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
284
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
322
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
382
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
413
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
451
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
486
var
connection = CreateHubConnection(server.Url, "/default", HttpTransportType.WebSockets, protocol, LoggerFactory);
532
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
567
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
604
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
652
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
690
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
722
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
764
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
794
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
831
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
878
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
931
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
972
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
1013
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
1048
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory);
1076
var
connection = CreateHubConnection(server.Url, hubPath, transportType, hubProtocol, LoggerFactory);
1103
var
connection = CreateHubConnection(server.Url, hubPath, transportType, hubProtocol, LoggerFactory);
1130
var
connection = CreateHubConnection(server.Url, "/default", HttpTransportType.LongPolling, hubProtocol, LoggerFactory);
1157
var
connection = CreateHubConnection(server.Url, hubPath, transportType, hubProtocol, LoggerFactory);
1184
var
connection = CreateHubConnection(server.Url, hubPath, transportType, hubProtocol, LoggerFactory);
1212
var
connection = CreateHubConnection(server.Url, hubPath, transportType, hubProtocol, LoggerFactory);
1240
var
connection = CreateHubConnection(server.Url, hubPath, transportType, hubProtocol, LoggerFactory);
1268
var
connection = CreateHubConnection(server.Url, hubPath, transportType, hubProtocol, LoggerFactory);
1295
var
connection = CreateHubConnection(server.Url, hubPath, transportType, hubProtocol, LoggerFactory);
1322
var
connection = CreateHubConnection(server.Url, hubPath, transportType, hubProtocol, LoggerFactory);
1362
var
connection = CreateHubConnection(server.Url, "/default", HttpTransportType.WebSockets, protocol, LoggerFactory);
1416
var
connection = CreateHubConnection(server.Url, "/default", HttpTransportType.LongPolling, protocol, LoggerFactory);
1459
var
connection = CreateHubConnection(server.Url, hubPath, transportType, hubProtocol, LoggerFactory);
1483
var
hubConnection = new HubConnectionBuilder()
1519
var
hubConnection = new HubConnectionBuilder()
1541
var
hubConnection = new HubConnectionBuilder()
1569
var
hubConnection = new HubConnectionBuilder()
1600
var
hubConnection = new HubConnectionBuilder()
1642
var
hubConnection = new HubConnectionBuilder()
1677
var
hubConnection = new HubConnectionBuilder()
1717
var
hubConnection = new HubConnectionBuilder()
1759
var
hubConnection = new HubConnectionBuilder()
1817
var
hubConnection = new HubConnectionBuilder()
1877
var
hubConnection = new HubConnectionBuilder()
1920
var
hubConnection = new HubConnectionBuilder()
1973
var
hubConnection = new HubConnectionBuilder()
2000
var
hubConnection = new HubConnectionBuilder()
2036
var
hubConnection = new HubConnectionBuilder()
2072
var
hubConnection = hubConnectionBuilder.Build();
2098
var
hubConnection = new HubConnectionBuilder()
2139
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
2145
var
connection = CreateHubConnection(
2200
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
2206
var
connection = new HubConnectionBuilder()
2260
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
2276
var
connection = connectionBuilder.Build();
2328
await using
var
connection = CreateHubConnection(server.Url, "/default", transportType, HubProtocols["json"], LoggerFactory);
2377
var
hubConnection = new HubConnectionBuilder()
2430
var
hubConnection = new HubConnectionBuilder()
2473
var
hubConnection = new HubConnectionBuilder()
2523
var
hubConnection = new HubConnectionBuilder()
2575
var
connection = connectionBuilder.Build();
2633
var
connection = connectionBuilder.Build();
2708
var
connection = connectionBuilder.Build();
2772
var
connection = connectionBuilder.Build();
2816
var
connection = connectionBuilder.Build();
2851
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
2879
var
connection = connectionBuilder.Build();
HubConnectionTests.Tracing.cs (11)
64
var
connection = connectionBuilder.Build();
187
Assert.Equal(
HubConnection
.ActivityName, clientActivity1.OperationName);
204
Assert.Equal(
HubConnection
.ActivityName, clientActivity2.OperationName);
253
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory, activitySourceContainer: clientSourceContainer);
347
Assert.Equal(
HubConnection
.ActivityName, clientActivity.OperationName);
397
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory, activitySourceContainer: clientSourceContainer);
500
var
connection = CreateHubConnection(server.Url, path, transportType, protocol, LoggerFactory, activitySourceContainer: clientSourceContainer);
602
var
connection = connectionBuilder.Build();
646
Assert.Equal(
HubConnection
.ActivityName, clientActivity.OperationName);
692
var
connection = connectionBuilder.Build();
742
Assert.Equal(
HubConnection
.ActivityName, clientActivity.OperationName);
HubProtocolVersionTests.cs (5)
45
var
connection = connectionBuilder.Build();
78
var
connection = connectionBuilder.Build();
123
var
connection = connectionBuilder.Build();
167
return writeContext.LoggerName == typeof(
HubConnection
).FullName;
177
var
connection = connectionBuilder.Build();
Microsoft.AspNetCore.SignalR.Client.Tests (153)
HubClientProxyGeneratorTests.cs (4)
21
public static partial IDisposable SetHubClient<T>(this
HubConnection
conn, T p);
105
var
conn = mockConn.Object;
156
var
conn = mockConn.Object;
239
var
conn = mockConn.Object;
HubConnectionBuilderTests.cs (3)
89
var
connection = builder.Build();
102
var
connection = builder.Build();
117
var
connection = builder.Build();
HubConnectionTests.ConnectionLifecycle.cs (18)
28
private static readonly IDictionary<string, Func<
HubConnection
, Task>> MethodsThatRequireActiveConnection = new Dictionary<string, Func<
HubConnection
, Task>>()
30
{ nameof(
HubConnection
.InvokeCoreAsync), (connection) => connection.InvokeAsync("Foo") },
31
{ nameof(
HubConnection
.SendCoreAsync), (connection) => connection.SendAsync("Foo") },
32
{ nameof(
HubConnection
.StreamAsChannelCoreAsync), (connection) => connection.StreamAsChannelAsync<object>("Foo") },
155
if (writeContext.LoggerName == typeof(
HubConnection
).FullName)
229
if (string.Equals(name, nameof(
HubConnection
.InvokeCoreAsync)))
378
Assert.Equal($"The '{nameof(
HubConnection
.SendCoreAsync)}' method cannot be called if the connection is not active", ex.Message);
413
Assert.Equal($"The '{nameof(
HubConnection
.SendCoreAsync)}' method cannot be called if the connection is not active", ex.Message);
451
Assert.Equal($"The '{nameof(
HubConnection
.SendCoreAsync)}' method cannot be called if the connection is not active", ex.Message);
494
if (writeContext.LoggerName == typeof(
HubConnection
).FullName)
511
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
540
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
561
if (writeContext.LoggerName == typeof(
HubConnection
).FullName)
582
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
616
var
hubConnection = builder.Build();
646
private static async Task AsyncUsing(
HubConnection
connection, Func<
HubConnection
, Task> action)
HubConnectionTests.cs (39)
30
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
36
var
hubConnection = CreateHubConnection(new TestConnection(), protocol: MockHubProtocol.Throw(exception), LoggerFactory);
51
var
hubConnection = CreateHubConnection(new TestConnection(), protocol: MockHubProtocol.Throw(exception), LoggerFactory);
69
var
hubConnection = builder.Build();
86
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
106
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
131
var
hubConnection = CreateHubConnection(new TestConnection(), loggerFactory: LoggerFactory);
146
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
153
var
hubConnection = CreateHubConnection(connection, protocol: Mock.Of<IHubProtocol>(), LoggerFactory);
171
var
hubConnection = CreateHubConnection(new TestConnection(), loggerFactory: LoggerFactory);
188
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
207
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
227
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
249
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
268
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
287
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
317
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
350
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
355
var
hubConnection = CreateHubConnection(new TestConnection(), loggerFactory: LoggerFactory);
381
var
hubConnection = CreateHubConnection(testConnection, loggerFactory: LoggerFactory);
407
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
413
var
hubConnection = CreateHubConnection(new TestConnection(), loggerFactory: LoggerFactory);
435
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
475
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
506
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
550
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
582
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
608
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
642
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
667
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
674
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
707
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
753
await using
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
767
var
connection = new HubConnectionBuilder()
812
var
hubConnection = CreateHubConnection(connection, loggerFactory: LoggerFactory);
844
var mockConnection = new Mock<
HubConnection
>(new Mock<IConnectionFactory>().Object, new Mock<IHubProtocol>().Object, new Mock<EndPoint>().Object,
858
var
hubConnection = mockConnection.Object;
896
var
hubConnection = builder.Build();
928
var
hubConnection = builder.Build();
HubConnectionTests.Extensions.cs (8)
214
private async Task InvokeOn(Action<
HubConnection
, TaskCompletionSource<object[]>> onAction, object[] args)
217
var
hubConnection = CreateHubConnection(connection);
245
var
hubConnection = CreateHubConnection(connection);
283
var
hubConnection = CreateHubConnection(connection);
325
var
hubConnection = CreateHubConnection(connection);
363
var
hubConnection = CreateHubConnection(connection);
674
private async Task<JToken> InvokeOnWithResult(Action<
HubConnection
, TaskCompletionSource<object[]>> onAction, object[] args)
677
var
hubConnection = CreateHubConnection(connection);
HubConnectionTests.Helpers.cs (1)
15
private static
HubConnection
CreateHubConnection(
HubConnectionTests.Protocol.cs (35)
21
var
hubConnection = CreateHubConnection(connection);
46
var
hubConnection = CreateHubConnection(connection);
72
var
hubConnection = CreateHubConnection(connection);
102
var
hubConnection = CreateHubConnection(connection);
121
var
hubConnection = CreateHubConnection(connection);
148
var
hubConnection = CreateHubConnection(connection);
177
var
hubConnection = CreateHubConnection(connection);
204
var
hubConnection = CreateHubConnection(connection);
231
var
hubConnection = CreateHubConnection(connection);
253
var
hubConnection = CreateHubConnection(connection);
275
var
hubConnection = CreateHubConnection(connection);
297
var
hubConnection = CreateHubConnection(connection);
320
var
hubConnection = CreateHubConnection(connection);
343
var
hubConnection = CreateHubConnection(connection);
366
var
hubConnection = CreateHubConnection(connection);
389
var
hubConnection = CreateHubConnection(connection);
416
var
hubConnection = CreateHubConnection(connection);
440
var
hubConnection = CreateHubConnection(connection);
472
var
hubConnection = CreateHubConnection(connection);
506
var
hubConnection = CreateHubConnection(connection);
535
var
hubConnection = CreateHubConnection(connection);
564
var
hubConnection = CreateHubConnection(connection);
591
var
hubConnection = CreateHubConnection(connection);
627
var
hubConnection = CreateHubConnection(connection);
653
var
hubConnection = CreateHubConnection(connection);
682
var
hubConnection = CreateHubConnection(connection);
706
var
hubConnection = CreateHubConnection(connection);
727
var
hubConnection = CreateHubConnection(connection);
754
var
hubConnection = CreateHubConnection(connection);
781
var
hubConnection = CreateHubConnection(connection);
810
var
hubConnection = CreateHubConnection(connection);
832
var
hubConnection = CreateHubConnection(connection);
857
var
hubConnection = CreateHubConnection(connection);
882
var
hubConnection = CreateHubConnection(connection);
907
var
hubConnection = CreateHubConnection(connection);
HubConnectionTests.Reconnect.cs (26)
33
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
43
await using
var
hubConnection = CreateHubConnection(testConnection, loggerFactory: LoggerFactory);
74
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
124
await using
var
hubConnection = builder.Build();
188
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
225
await using
var
hubConnection = builder.Build();
283
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
320
await using
var
hubConnection = builder.Build();
380
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
400
await using
var
hubConnection = builder.Build();
476
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
498
await using
var
hubConnection = builder.Build();
560
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
586
await using
var
hubConnection = builder.Build();
622
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
636
await using
var
hubConnection = builder.Build();
676
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
691
await using
var
hubConnection = builder.Build();
732
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
761
await using
var
hubConnection = builder.Build();
838
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
868
await using
var
hubConnection = builder.Build();
958
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
994
await using
var
hubConnection = builder.Build();
1049
return writeContext.LoggerName == typeof(
HubConnection
).FullName &&
1072
await using
var
hubConnection = builder.Build();
HubConnectionTests.Tracing.cs (5)
36
var
hubConnection = CreateHubConnection(connection, clientActivitySource: clientSourceContainer);
73
var
hubConnection = CreateHubConnection(connection, clientActivitySource: clientSourceContainer);
111
var
hubConnection = CreateHubConnection(connection, clientActivitySource: clientSourceContainer);
150
var
hubConnection = CreateHubConnection(connection, clientActivitySource: clientSourceContainer);
189
var
hubConnection = CreateHubConnection(connection, clientActivitySource: clientSourceContainer);
HubServerProxyGeneratorTests.cs (10)
24
public static partial T GetHubServer<T>(this
HubConnection
conn);
63
var
conn = mockConn.Object;
85
var
conn = mockConn.Object;
108
var
conn = mockConn.Object;
134
var
conn = mockConn.Object;
158
var
conn = mockConn.Object;
200
var
conn = mockConn.Object;
240
var
conn = mockConn.Object;
293
var
conn = mockConn.Object;
325
var
conn = mockConn.Object;
MockHubConnection.cs (2)
15
public static Mock<
HubConnection
> Get()
22
return new Mock<
HubConnection
>(MockBehavior.Strict,
TestServerTests.cs (2)
55
var
connection = connectionBuilder.Build();
100
var
connection = connectionBuilder.Build();
Microsoft.AspNetCore.SignalR.Microbenchmarks (3)
HubConnectionReceiveBenchmark.cs (1)
25
private
HubConnection
_hubConnection;
HubConnectionSendBenchmark.cs (1)
20
private
HubConnection
_hubConnection;
HubConnectionStartBenchmark.cs (1)
20
private
HubConnection
_hubConnection;
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (12)
RedisEndToEnd.cs (12)
46
var
connection = CreateConnection(_serverFixture.FirstServer.Url + "/echo", transportType, protocol, LoggerFactory);
66
var
connection = CreateConnection(_serverFixture.FirstServer.Url + "/echo", transportType, protocol, LoggerFactory);
67
var
secondConnection = CreateConnection(_serverFixture.SecondServer.Url + "/echo", transportType, protocol, LoggerFactory);
98
var
connection = CreateConnection(_serverFixture.FirstServer.Url + "/echo", transportType, protocol, LoggerFactory, userName: "userA");
99
var
secondConnection = CreateConnection(_serverFixture.SecondServer.Url + "/echo", transportType, protocol, LoggerFactory, userName: "userA");
130
var
firstConnection = CreateConnection(_serverFixture.FirstServer.Url + "/echo", transportType, protocol, LoggerFactory, userName: "userA");
131
var
secondConnection = CreateConnection(_serverFixture.SecondServer.Url + "/echo", transportType, protocol, LoggerFactory, userName: "userA");
156
var
connection = CreateConnection(_serverFixture.FirstServer.Url + "/echo", transportType, protocol, LoggerFactory);
157
var
secondConnection = CreateConnection(_serverFixture.SecondServer.Url + "/echo", transportType, protocol, LoggerFactory);
192
var
connection = CreateConnection(_serverFixture.FirstServer.Url + "/echo", transportType, protocol, LoggerFactory, userName: "*");
193
var
secondConnection = CreateConnection(_serverFixture.SecondServer.Url + "/echo", transportType, protocol, LoggerFactory, userName: "userA");
215
private static
HubConnection
CreateConnection(string url, HttpTransportType transportType, IHubProtocol protocol, ILoggerFactory loggerFactory, string userName = null)
Microsoft.AspNetCore.SignalR.Tests (4)
EndToEndTests.cs (3)
547
var
connection = new HubConnectionBuilder()
612
var
connection = new HubConnectionBuilder()
660
var
connection = new HubConnectionBuilder()
NativeAotTests.cs (1)
34
var
connection = hubConnectionBuilder.Build();