public Task IpcServerRun() { if (null == _ipcServiceHost) { return(Task.CompletedTask); } NLogMgr.DebugLog(_programLog, "IpcServer端启动"); PingServiceContract.ResponseConfigModified += ToolCofigurationModified; PingServiceContract.ResponseJobRestart += JobRestart; PingServiceContract.ResponseStopJob += StopJob; _source = new CancellationTokenSource(); _ipcServiceHost.RunAsync(_source.Token); return(Task.CompletedTask); }
public void Start() { _host.RunAsync(_cancellationTokenSource.Token); }
public TaskInformation(IHostApplicationLifetime applicationLifetime, IIpcServiceHost host) { _lifetimeAppStopRegistration = applicationLifetime.ApplicationStopping.Register(() => AppStopCts.Cancel()); IpcTask = Task.Run(() => host.RunAsync(AppStopCts.Token)); }