/// <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); } }
/// <inheritdoc /> protected sealed override IHostService AcquireHostService() { IRemoteHostService remoteHostService = AcquireRemoteHostService(); if (remoteHostService == null) { return(null); } StartPingTimer(); return(new ProxyHostService(remoteHostService)); }
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; }
public ProxyHostService(IRemoteHostService hostService) { this.hostService = hostService; }