Azure / azure-signalr

Azure SignalR Service SDK for .NET
https://aka.ms/signalr-service
MIT License
427 stars 101 forks source link

ASP.NET SignalR KeepAlive Time #267

Open wolfet opened 6 years ago

wolfet commented 6 years ago

Using the SignalR 2.4.0 Nuget package along with Microsoft.Azure.SignalR.AspNet 1.0.0-preview1-10259, the keep alive message time does not change when set on GlobalHost.Configuration.KeepAlive. It appears to be fixed at roughly 15 seconds when connected with websockets. Is this intentional or is there another way to set the KeepAlive message time?

Here is the applicable C# code in Startup.cs with KeepAlive set before calling MapAzureSignalR:

GlobalHost.Configuration.KeepAlive = TimeSpan.FromSeconds(4);
app.MapAzureSignalR("/signalr", "myapp", new HubConfiguration()
{
    EnableDetailedErrors = false,
    EnableJavaScriptProxies = false,
    EnableJSONP = false
},
map =>
{
    map.AccessTokenLifetime = TimeSpan.FromDays(1);
    map.ConnectionCount = 5;

    GlobalHost.DependencyResolver.Register(
        typeof(JsonSerializer),
        () => JsonSerializerFactory.Value);
});
vicancy commented 6 years ago

This is not yet configurable.