React to Hosting changes

This commit is contained in:
John Luo 2017-05-26 00:12:30 -07:00
parent cb9f44ddf6
commit 47ac4e5bf9
1 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,8 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
namespace Microsoft.AspNetCore.Sockets namespace Microsoft.AspNetCore.Sockets
@ -14,14 +16,16 @@ namespace Microsoft.AspNetCore.Sockets
_connectionManager = connectionManager; _connectionManager = connectionManager;
} }
public void Start() public Task StartAsync(CancellationToken token)
{ {
_connectionManager.Start(); _connectionManager.Start();
return Task.CompletedTask;
} }
public void Stop() public Task StopAsync(CancellationToken token)
{ {
_connectionManager.CloseConnections(); _connectionManager.CloseConnections();
return Task.CompletedTask;
} }
} }
} }