Skip to content

Fix keepalive timer logic#597

Merged
xmrig merged 1 commit into
xmrig:masterfrom
HashVault:fix-keepalive-timer
Mar 28, 2026
Merged

Fix keepalive timer logic#597
xmrig merged 1 commit into
xmrig:masterfrom
HashVault:fix-keepalive-timer

Conversation

@HashVault

Copy link
Copy Markdown
Contributor

Reset keepalive timer on send instead of receive - the pool needs to know the client is alive, not the other way around.

Also remove m_keepAlive = 0 in ping() which was disabling the timer after the first ping, so only one keepalive would ever be sent.

- Reset timer on send instead of receive (pool needs to know we're alive)
- Remove timer disable after first ping to enable continuous keepalives

The previous implementation only sent one keepalive ping because
m_keepAlive was set to 0 after ping(), disabling the timer. Also,
resetting the timer on receive doesn't make sense - the pool needs to
know the client is still alive, which requires activity from the client
side, not just receiving data.
@xmrig xmrig added the bug label Jan 21, 2026
@xmrig

xmrig commented Jan 21, 2026

Copy link
Copy Markdown
Owner

Merged into the dev branch. This PR will be closed automatically when the dev branch is merged into master.

Thank you.

@xmrig xmrig merged commit ccd5e46 into xmrig:master Mar 28, 2026
@HashVault HashVault deleted the fix-keepalive-timer branch April 6, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants