This commit fixes an issue that occurred when auto-reconnection is enabled,
and the client is disconnected from the server. In this situation, if the
esp_websocket_client_stop() method is called, the caller could remain stuck
waiting for a maximum time equal to half of wait_timeout_ms.
This fix allows the esp_websocket_client_task to be woken up when it is
waiting to reconnect, so it can be closed promptly when requested.
1.5.0
Features
- add separate tx lock for send and receive (250eebf)
- add unregister event to websocket client (ce16050)
- add ability to reconnect after close (19891d8)
Bug Fixes
- release client-lock during WEBSOCKET_EVENT_DATA (030cb75)
This resolves:
1) Deadlock when trying to reserve a lock in WEBSOCKET_EVENT_DATA,
but lock is held by a thread trying to send a websocket message.
2) High latency caused by writers serialized with WEBSOCKET_EVENT_DATA
while calling esp_websocket_client_send(), even when TCP window
has enough space for the entire message being queued to send.
Multiple writers are still serialized at fragment boundaries, but
only with other writers and websocket error updates.
Fixes#625
1.3.0
Features
- add events for begin/end thread (d7fa24bc)
- Make example to use certificate bundle (aecf6f80)
- propagate esp_tls stack error and cert verify flags (234f579b)
- Add option to set and use cert_common_name in Websocket client (3a6720de)
- adding support for `if_name` when using WSS transport (333a6893)
- allow updating reconnect timeout for retry backoffs (bd9f0627)
- allow using external tcp transport handle (83ea2876)
- adding support for `keep_alive_enable` when using WSS transport (c728eae5)
Bug Fixes
- Prevent crash on network disconnect during send (a453ca1f)
- use proper interface to delete semaphore (991ac40d)
- Move client to different state when disconnecting (0d8f2a6d)
- fix of websocket host example (5ccc018a)
- don't get transport from the list if external transport is used (9d4d5d2d)
- Fix locking issues of `esp_websocket_client_send_with_exact_opcode` API (6393fcd7)
When WiFi disconnects, `esp_websocket_client_task` continues polling
`esp_transport_poll_read()` with a default 1-second timeout.
If a timeout triggers `esp_websocket_client_abort_connection`,
certain resources are released.
However, if `esp_websocket_client_send_with_exact_opcode`
is still blocked at this point, it will cause a crash
when it times out and accesses the released handle.
This fix prevents potential crashes by ensuring proper
synchronization between abort and send functions.
Merges: https://github.com/espressif/esp-protocols/pull/629
On most implementations, including ESP-IDF FreeRTOS, vSemaphoreDelete()
is a macro that calls vQueueDelete(). But since the client semaphore is
created with xSemaphoreCreateRecursiveMutex(), delete it as a semaphore with vSemaphoreDelete().
1.2.3
Features
- Expanded example to demonstrate the transfer over TLS (0d0630ed76)
Bug Fixes
- fix esp_event dependency management (1fb02a9a60)
- Skip warn on zero timeout and auto reconnect is disabled (5b467cbf5c)
- Fixed to use int return value in Tx functions (9c54b72e1f)
- Fixed Tx functions with DYNAMIC_BUFFER (16174470ee)
- added dependency checks, sdkconfig.defaults and refined README.md (312982e4aa)
- Close websocket and dispatch event if server does not close within a reasonable amount of time. (d85311880d)
- Continue waiting for TCP connection to be closed (2b092e0db4)
Updated
- docs(websocket): Added README for websocket host example (2f7c58259d)
Move esp_event from PRIV_REQUIRES to REQUIRES, as it is
included by esp_websocket_client.h, so any code including
that header also requires esp_event.
This resolves the following build error for files not
explicitly requiring esp_event:
ninja: build stopped: subcommand failed.
Compilation failed because esp_websocket_client.h (in "espressif__esp_websocket_client" component) includes esp_event.h, provided by esp_event component(s).
However, esp_event component(s) is in the private requirements list of "espressif__esp_websocket_client".
To fix this, move esp_event from PRIV_REQUIRES into REQUIRES list of idf_component_register call in ...\managed_components\espressif__esp_websocket_client\CMakeLists.txt.
ninja failed with exit code 1, output of the command is in...