Split out 'socket' hosting model into a separate optional NuGet package, since most developers won't need it

This commit is contained in:
SteveSandersonMS
2016-11-30 11:59:56 +00:00
parent ebf5a18344
commit 832da2a451
24 changed files with 244 additions and 135 deletions

View File

@@ -3,6 +3,7 @@ using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.NodeServices;
using Microsoft.AspNetCore.NodeServices.Sockets;
using Microsoft.Extensions.DependencyInjection;
namespace ConsoleApplication
@@ -16,6 +17,10 @@ namespace ConsoleApplication
// Set up the DI system
var services = new ServiceCollection();
services.AddNodeServices(options => {
// To compare with Socket hosting, uncomment the following line
// Since .NET Core 1.1, the HTTP hosting model has become basically as fast as the Socket hosting model
//options.UseSocketHosting();
options.ProjectPath = Directory.GetCurrentDirectory();
options.WatchFileExtensions = new string[] {}; // Don't watch anything
});

View File

@@ -9,6 +9,7 @@
"type": "platform"
},
"Microsoft.AspNetCore.NodeServices": "1.1.0-*",
"Microsoft.AspNetCore.NodeServices.Sockets": "1.1.0-*",
"Microsoft.Extensions.DependencyInjection": "1.1.0"
},
"frameworks": {