Skip to content

Commit 3d24044

Browse files
fix: RGB watchdog — 15s interval, explicit disconnect before reconnect
Root cause: watchdog reconnected every 5s without closing old socket, creating 100+ TIME_WAIT connections that exhausted ephemeral ports. - Watchdog interval: 5s -> 15s (reduces TIME_WAIT pressure) - Explicit Disconnect() call before ConnectAsync() in watchdog - Overlay defaults: transparent=false, topmost=false (already pushed)
1 parent 9ab6fd2 commit 3d24044

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Fanzi.FanControl/ViewModels/RgbControlViewModel.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,11 +386,14 @@ private async Task ConnectionWatchdogAsync(CancellationToken token)
386386
{
387387
try
388388
{
389-
await Task.Delay(5000, token);
389+
await Task.Delay(15000, token);
390390
if (!RgbEnabled || _autoStartInProgress) continue;
391391

392392
if (!_rgbService.IsConnected && OpenRgbServerManager.IsPortListening(OpenRgbPort))
393393
{
394+
// Properly dispose the old client BEFORE reconnecting —
395+
// prevents socket leak and TIME_WAIT accumulation.
396+
_rgbService.Disconnect();
394397
ConnectionStatus = "AEDi: Reconnecting...";
395398
await ConnectAsync();
396399
if (IsConnected)

0 commit comments

Comments
 (0)