Skip to content

Commit e51ebd2

Browse files
committed
nits
1 parent 62a31cc commit e51ebd2

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

src/SignalR/common/Http.Connections/src/ConnectionsDependencyInjectionExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System;
55
using Microsoft.AspNetCore.Http.Connections;
66
using Microsoft.AspNetCore.Http.Connections.Internal;
7+
using Microsoft.AspNetCore.Internal;
78
using Microsoft.Extensions.DependencyInjection.Extensions;
89
using Microsoft.Extensions.Options;
910

@@ -26,6 +27,7 @@ public static IServiceCollection AddConnections(this IServiceCollection services
2627
services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<ConnectionOptions>, ConnectionOptionsSetup>());
2728
services.TryAddSingleton<HttpConnectionDispatcher>();
2829
services.TryAddSingleton<HttpConnectionManager>();
30+
services.TryAddSingleton<ISystemClock, SystemClock>();
2931
return services;
3032
}
3133

src/SignalR/common/Http.Connections/src/Internal/HttpConnectionManager.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ internal partial class HttpConnectionManager
3333
private readonly TimeSpan _disconnectTimeout;
3434
private readonly ISystemClock _systemClock;
3535

36-
public HttpConnectionManager(ILoggerFactory loggerFactory, IHostApplicationLifetime appLifetime)
37-
: this(loggerFactory, appLifetime, Options.Create(new ConnectionOptions() { DisconnectTimeout = ConnectionOptionsSetup.DefaultDisconectTimeout }), new SystemClock())
38-
{
39-
}
40-
4136
public HttpConnectionManager(ILoggerFactory loggerFactory, IHostApplicationLifetime appLifetime, IOptions<ConnectionOptions> connectionOptions, ISystemClock systemClock)
4237
{
4338
_logger = loggerFactory.CreateLogger<HttpConnectionManager>();

src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2347,10 +2347,10 @@ private static void SetTransport(HttpContext context, HttpTransportType transpor
23472347

23482348
private static HttpConnectionManager CreateConnectionManager(ILoggerFactory loggerFactory)
23492349
{
2350-
return new HttpConnectionManager(loggerFactory ?? new LoggerFactory(), new EmptyApplicationLifetime());
2350+
return CreateConnectionManager(loggerFactory, null);
23512351
}
23522352

2353-
private static HttpConnectionManager CreateConnectionManager(ILoggerFactory loggerFactory, TimeSpan disconnectTimeout)
2353+
private static HttpConnectionManager CreateConnectionManager(ILoggerFactory loggerFactory, TimeSpan? disconnectTimeout)
23542354
{
23552355
var connectionOptions = new ConnectionOptions();
23562356
connectionOptions.DisconnectTimeout = disconnectTimeout;

src/SignalR/common/Http.Connections/test/HttpConnectionManagerTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Threading.Tasks;
88
using Microsoft.AspNetCore.Hosting;
99
using Microsoft.AspNetCore.Http.Connections.Internal;
10+
using Microsoft.AspNetCore.Internal;
1011
using Microsoft.AspNetCore.SignalR.Tests;
1112
using Microsoft.Extensions.Hosting;
1213
using Microsoft.Extensions.Logging;
@@ -411,7 +412,7 @@ public async Task ApplicationLifetimeCanStartBeforeHttpConnectionManagerInitiali
411412
private static HttpConnectionManager CreateConnectionManager(ILoggerFactory loggerFactory, IHostApplicationLifetime lifetime = null)
412413
{
413414
lifetime = lifetime ?? new EmptyApplicationLifetime();
414-
return new HttpConnectionManager(loggerFactory, lifetime);
415+
return new HttpConnectionManager(loggerFactory, lifetime, Options.Create(new ConnectionOptions()), new SystemClock());
415416
}
416417

417418
[Flags]

src/SignalR/server/SignalR/test/HubConnectionHandlerTestUtils/MockSystemClock.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
14
using System;
25
using System.Threading;
36
using Microsoft.AspNetCore.Internal;

0 commit comments

Comments
 (0)