From 50f76dc8541dedac6ad9dff055cab809e2f33543 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 11 Jul 2025 17:46:50 -0500 Subject: remove interface --- src/slskd/Core/ConnectionWatchdog.cs | 40 +++--------------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/slskd/Core/ConnectionWatchdog.cs b/src/slskd/Core/ConnectionWatchdog.cs index 494be488..f8461033 100644 --- a/src/slskd/Core/ConnectionWatchdog.cs +++ b/src/slskd/Core/ConnectionWatchdog.cs @@ -25,40 +25,6 @@ namespace slskd using Serilog; using Soulseek; - /// - /// Monitors the connection to the Soulseek server and reconnects with exponential backoff, if necessary. - /// - public interface IConnectionWatchdog : IDisposable - { - /// - /// Gets a value indicating whether the watchdog is monitoring the server connection. - /// - /// - /// Generally true when the application *SHOULD* be connected to the server, but isn't. - /// Otherwise false (e.g. when connected). - /// - bool IsEnabled { get; } - - /// - /// Initializes the watchdog and makes the initial connection to the server. - /// - /// This should be called at application startup. - void Start(); - - /// - /// Starts monitoring the server connection following a disconnect. - /// - /// This should be called when the connection is disconnected. - void Restart(); - - /// - /// Stops monitoring the server connection. - /// - /// A value indicating whether to abort an ongoing reconnect attempt. - /// This should be called when the application is reasonably certain that the connection is connected. - void Stop(bool abortReconnect = false); - } - /// /// Monitors the connection to the Soulseek network and reconnects with exponential backoff, if necessary. /// @@ -66,7 +32,7 @@ namespace slskd /// This class is intended to be Started either at application startup or when the connection is disconnected, and /// stopped when the application is connected again; it doesn't "run" all the time. /// - public class ConnectionWatchdog : IConnectionWatchdog + public class ConnectionWatchdog { private static readonly int ReconnectMaxDelayMilliseconds = 300000; // 5 minutes @@ -122,7 +88,7 @@ namespace slskd /// Initializes the watchdog and makes the initial connection to the server. /// /// This should be called at application startup. - public void Start() + public virtual void Start() { WatchdogTimer.Enabled = true; _ = AttemptReconnect(attempts: 0); @@ -143,7 +109,7 @@ namespace slskd /// /// A value indicating whether to abort an ongoing reconnect attempt. /// This should be called when the application is reasonably certain that the connection is connected. - public void Stop(bool abortReconnect = false) + public virtual void Stop(bool abortReconnect = false) { WatchdogTimer.Enabled = false; -- cgit v1.2.3