From ac2aca6a2dd4c6299d7b39a99b5545e94d1efbe4 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Mon, 14 Jun 2021 07:56:48 -0500 Subject: throw ApplicationShutdownException when stopping, don't try to reconnect if caught --- src/slskd/Core/Service.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/slskd/Core/Service.cs b/src/slskd/Core/Service.cs index 5800ffa0..7a1e511f 100644 --- a/src/slskd/Core/Service.cs +++ b/src/slskd/Core/Service.cs @@ -154,7 +154,7 @@ namespace slskd public Task StopAsync(CancellationToken cancellationToken) { - Client.Disconnect("Shutting down"); + Client.Disconnect("Shutting down", new ApplicationShutdownException("Shutting down")); Client.Dispose(); Logger.Information("Client stopped"); return Task.CompletedTask; @@ -213,7 +213,7 @@ namespace slskd private async void Client_Disconnected(object sender, SoulseekClientDisconnectedEventArgs args) { - if (args.Exception is ObjectDisposedException) + if (args.Exception is ObjectDisposedException || args.Exception is ApplicationShutdownException) { Logger.Debug("Disconnected from the Soulseek server: the client is shutting down"); } -- cgit v1.2.3