public void Stop() { if (sender != null) { sender.StopSending(); } if (serviceHost != null) { serviceHost.Close(); } if (cleaner != null) { cleaner.Stop(); } }
public Task StopAsync(CancellationToken cancellationToken) { NotifyService.Stop(); if (NotifySender != null) { NotifySender.StopSending(); } if (NotifyCleaner != null) { NotifyCleaner.Stop(); } return(Task.CompletedTask); }