Esempio n. 1
0
        /// <inheritdoc />
        protected override IRemoteHostService AcquireRemoteHostService()
        {
            try
            {
                string hostConnectionArguments;
                GallioFunc <IClientChannel> clientChannelFactory;
                GallioFunc <IServerChannel> callbackChannelFactory;
                PrepareConnection(uniqueId, out hostConnectionArguments, out clientChannelFactory, out callbackChannelFactory);

                StartProcess(hostConnectionArguments);
                EnsureProcessIsRunning();

                clientChannel   = clientChannelFactory();
                callbackChannel = callbackChannelFactory();

                IRemoteHostService hostService = HostServiceChannelInterop.GetRemoteHostService(clientChannel);
                WaitUntilReady(hostService);
                return(hostService);
            }
            catch (Exception ex)
            {
                FreeResources(true);
                throw new HostException("Error attaching to the host process.", ex);
            }
        }
Esempio n. 2
0
        /// <inheritdoc />
        protected sealed override IHostService AcquireHostService()
        {
            IRemoteHostService remoteHostService = AcquireRemoteHostService();

            if (remoteHostService == null)
            {
                return(null);
            }

            StartPingTimer();
            return(new ProxyHostService(remoteHostService));
        }
Esempio n. 3
0
            protected override void Dispose(bool disposing)
            {
                base.Dispose(disposing);

                if (hostService != null)
                {
                    try
                    {
                        hostService.Shutdown();
                    }
                    catch (Exception)
                    {
                        // Ignore the exception since we're shutting down anyways.
                    }
                }

                hostService = null;
            }
Esempio n. 4
0
 public ProxyHostService(IRemoteHostService hostService)
 {
     this.hostService = hostService;
 }