コード例 #1
0
ファイル: HostEndpoint.cs プロジェクト: citizenmatt/gallio
        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);
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        public void TestRemoteHostCreation()
        {
            var streams = FullDuplexStream.CreateStreams();

            using var _ = new RemoteHostService(streams.Item1, new InProcRemoteHostClient.ServiceProvider(runCacheCleanup: false));
        }