public HostTerminationReason Run(TimeSpan?watchdogTimeout) { using (RemoteHostService hostService = new RemoteHostService(watchdogTimeout)) { if (ownerProcess != null) { ownerProcess.Exited += delegate { hostService.Dispose(); }; ownerProcess.EnableRaisingEvents = true; } if (ownerProcess == null || !ownerProcess.HasExited) { HostServiceChannelInterop.RegisterWithChannel(hostService, serverChannel); hostService.WaitUntilShutdown(); } if (hostService.WatchdogTimerExpired) { return(HostTerminationReason.WatchdogTimeout); } if (ownerProcess != null && ownerProcess.HasExited) { return(HostTerminationReason.Disowned); } } return(HostTerminationReason.Disposed); }
public void TestRemoteHostCreation() { var remoteLogger = new TraceSource("inprocRemoteClient"); var testData = new RemoteHostTestData(new RemoteWorkspaceManager(new SolutionAssetCache()), isInProc: true); var streams = FullDuplexStream.CreatePair(); using var _ = new RemoteHostService(streams.Item1, new InProcRemoteHostClient.ServiceProvider(remoteLogger, testData)); }
public void TestRemoteHostCreation() { var streams = FullDuplexStream.CreateStreams(); using var _ = new RemoteHostService(streams.Item1, new InProcRemoteHostClient.ServiceProvider(runCacheCleanup: false)); }