Skip to content

exponential backoff for ws reconnection#130

Open
FelipeTrost wants to merge 2 commits intosnapcast:developfrom
FelipeTrost:ws-exponential-backoff
Open

exponential backoff for ws reconnection#130
FelipeTrost wants to merge 2 commits intosnapcast:developfrom
FelipeTrost:ws-exponential-backoff

Conversation

@FelipeTrost
Copy link
Copy Markdown

@FelipeTrost FelipeTrost commented Apr 17, 2025

On mobile devices WS connections close after a few seconds of closing the browser, having to wait a 1s each time I open the website feels a bit slow.

In this PR I implemented exponential backoff for the reconnection delay like this: (1.1 ^ reconnectionAttempts) - 1.
The -1 is so that the first reconnection happens instantly.

PS: I even think, no delay at all is the best way to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant