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