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);
        }
Exemple #2
0
 public void Start()
 {
     _host.RunAsync(_cancellationTokenSource.Token);
 }
Exemple #3
0
 public TaskInformation(IHostApplicationLifetime applicationLifetime, IIpcServiceHost host)
 {
     _lifetimeAppStopRegistration =
         applicationLifetime.ApplicationStopping.Register(() => AppStopCts.Cancel());
     IpcTask = Task.Run(() => host.RunAsync(AppStopCts.Token));
 }