Move logic for restarting Node child process into NodeServicesImpl. Tidy up lots.

This commit is contained in:
SteveSandersonMS
2016-07-07 11:35:25 +01:00
parent 4fb3b18868
commit a19e37f3c0
8 changed files with 245 additions and 206 deletions

View File

@@ -48,7 +48,8 @@ namespace Microsoft.AspNetCore.NodeServices
case NodeHostingModel.Http:
return new HttpNodeInstance(options.ProjectPath, /* port */ 0, options.WatchFileExtensions);
case NodeHostingModel.Socket:
return new SocketNodeInstance(options.ProjectPath, options.WatchFileExtensions);
var pipeName = "pni-" + Guid.NewGuid().ToString("D"); // Arbitrary non-clashing string
return new SocketNodeInstance(options.ProjectPath, options.WatchFileExtensions, pipeName);
default:
throw new ArgumentException("Unknown hosting model: " + options.HostingModel);
}