protected override void OnAfterStart() { try { _address = Constants.BaseAddress + Pid; var binding = WcfUtils.GetNetNamedPipeBinding(); var ep = new EndpointAddress(_address); var type = typeof(IRemoteVstService); var proxyCreatorType = MakeGenericType(type); var proxyCreator = GetProxyCreator(proxyCreatorType, binding, ep); var x = _generator.CreateInterfaceProxyWithoutTarget(type, new[] { typeof(IContextChannel) }, CreateInterceptor(proxyCreator, type)); _vstService = x as IRemoteVstService; _vstService.Ping(); _vstServiceAvailable = true; IsBusy = false; _pingTimer.Start(); } catch (Exception ex) { ForceStop($"Failure when attempting to open the service channel: {ex}"); } }
public RemotePluginInstance(IVstHostProcess vstHostProcess, Plugin plugin, bool backgroundProcessing = true, bool debug = false) { Plugin = plugin; _debug = debug; _vstHostProcess = vstHostProcess; _vstHostProcess.Lock(plugin); Plugin.Logger.Debug($"Locking to PID {vstHostProcess.Pid}"); _remoteVstService = vstHostProcess.GetVstService(); RegisterPlugin(backgroundProcessing); }