Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(websocket): interruptable wait timeout #607

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

erkia
Copy link
Contributor

@erkia erkia commented Jul 3, 2024

Currently, websocket automatic reconnect delay is implemented using simple vTaskDelay(client->wait_timeout_ms / 2 / portTICK_PERIOD_MS). This has two drawbacks:

  • changing wait timeout while delay is already active has an unpredictable result
  • calling esp_websocket_client_stop() while delay is active will block until (half) reconnect delay is passed, which is especially annoying when delay is long.

This pull requests uses task notifications to wake up websocket task from reconnect delay when necessary.

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.

3 participants