21 lines
849 B
C#
21 lines
849 B
C#
using System.Diagnostics.CodeAnalysis;
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.AspNetCore.Routing;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace ClientApiPoC.Shared.SignalR {
|
|
public static class TunnelHubExtensions {
|
|
public static IServiceCollection AddTunnelHub(this IServiceCollection services) {
|
|
services.AddSignalR(options => {
|
|
// Nachrichtengröße auf max. 16MB bringen (Standard = 32KB).
|
|
options.MaximumReceiveMessageSize = (16 * 1024 * 1024);
|
|
});
|
|
services.AddSingleton<ClientTracker>();
|
|
return services;
|
|
}
|
|
|
|
public static HubEndpointConventionBuilder MapTunnelHub(this IEndpointRouteBuilder app, [StringSyntax("Route")] string pattern) {
|
|
return app.MapHub<TunnelHub>(pattern);
|
|
}
|
|
}
|
|
} |