release connected async akways

This commit is contained in:
Stanley Dimant
2022-09-23 12:45:24 +02:00
parent 588eb9f4ed
commit 8236d355a2

View File

@@ -56,6 +56,8 @@ public class SignalRLimitFilter : IHubFilter
public async Task OnConnectedAsync(HubLifetimeContext context, Func<HubLifetimeContext, Task> next)
{
await ConnectionLimiterSemaphore.WaitAsync().ConfigureAwait(false);
try
{
var ip = accessor.GetIpAddress();
var client = new ClientRequestIdentity
{
@@ -75,9 +77,8 @@ public class SignalRLimitFilter : IHubFilter
}
}
try
{
await Task.Delay(100).ConfigureAwait(false);
await Task.Delay(25).ConfigureAwait(false);
await next(context).ConfigureAwait(false);
}
catch (Exception ex)
@@ -102,7 +103,7 @@ public class SignalRLimitFilter : IHubFilter
try
{
await next(context, exception).ConfigureAwait(false);
await Task.Delay(250).ConfigureAwait(false);
await Task.Delay(25).ConfigureAwait(false);
}
catch (Exception e)
{