aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Core/State.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2025-07-12 14:58:53 -0500
committerGitHub <noreply@github.com>2025-07-12 14:58:53 -0500
commit367b2cee4d475277fb278e6537f1014436d5a09f (patch)
tree2bcdd9f727ebfbb57787ee203e6760a3e0f1e910 /src/slskd/Core/State.cs
parenteed42e9c4916e2ba653e40147de546e7af3af563 (diff)
parent11456386b8c3dcd6d054b2ceff5861a972fbe3cd (diff)
downloadslskd-367b2cee4d475277fb278e6537f1014436d5a09f.tar.gz
Merge pull request #1385 from slskd/dns
Adjust auto-reconnect logic
Diffstat (limited to 'src/slskd/Core/State.cs')
-rw-r--r--src/slskd/Core/State.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/slskd/Core/State.cs b/src/slskd/Core/State.cs
index 9ae6df6b..86b628b5 100644
--- a/src/slskd/Core/State.cs
+++ b/src/slskd/Core/State.cs
@@ -35,6 +35,7 @@ namespace slskd
public bool PendingReconnect { get; init; }
public bool PendingRestart { get; init; }
public ServerState Server { get; init; } = new ServerState();
+ public ServerConnectionWatchdogState ConnectionWatchdog { get; init; } = new ServerConnectionWatchdogState();
public RelayState Relay { get; init; } = new RelayState();
public UserState User { get; init; } = new UserState();
public DistributedNetworkState DistributedNetwork { get; init; } = new DistributedNetworkState();
@@ -61,10 +62,19 @@ namespace slskd
public IPEndPoint IPEndPoint { get; init; }
public SoulseekClientStates State { get; init; }
public bool IsConnected => State.HasFlag(SoulseekClientStates.Connected);
+ public bool IsConnecting => State.HasFlag(SoulseekClientStates.Connecting);
public bool IsLoggedIn => State.HasFlag(SoulseekClientStates.LoggedIn);
+ public bool IsLoggingIn => State.HasFlag(SoulseekClientStates.LoggingIn);
public bool IsTransitioning => State.HasFlag(SoulseekClientStates.Connecting) || State.HasFlag(SoulseekClientStates.Disconnecting) || State.HasFlag(SoulseekClientStates.LoggingIn);
}
+ public record ServerConnectionWatchdogState
+ {
+ public bool IsEnabled { get; init; } = false;
+ public bool IsAttemptingConnection { get; init; } = false;
+ public DateTime? NextAttemptAt { get; init; }
+ }
+
public record RelayState
{
public RelayMode Mode { get; init; }