Async Websocket client

sigma_shig
Posts: 6
Joined: Sun Apr 23, 2023 10:19 am

Async Websocket client

Postby sigma_shig » Sun May 14, 2023 8:07 am

Hi

Can anybody recommend any library for async Websocket client? I know async websocket server (as a part of AsyncWebServer) and I know a Websockets library with client implementation (https://github.com/Links2004/arduinoWebSockets) but it is require a loop, but I'm trying to avoid using a loop and switch to the async callbacks/events.

username
Posts: 532
Joined: Thu May 03, 2018 1:18 pm

Re: Async Websocket client

Postby username » Mon May 15, 2023 3:25 am


sigma_shig
Posts: 6
Joined: Sun Apr 23, 2023 10:19 am

Re: Async Websocket client

Postby sigma_shig » Mon May 15, 2023 7:32 am

This module is a websocket server. I'm looking for Websocket client for Arduino platform. I don't want to work wit ESP_IDF.

lbernstone
Posts: 826
Joined: Mon Jul 22, 2019 3:20 pm

Re: Async Websocket client

Postby lbernstone » Mon May 15, 2023 6:58 pm

AsyncWebserver is a polling loop under the covers, so your request is pretty meaningless.
Any async process is going to be prone to race conditions and tight timing windows. These are best solved with the FreeRTOS mutex and queue methods (https://github.com/espressif/arduino-es ... s/FreeRTOS). AsyncWebserver websockets has worked well for me and many others.

sigma_shig
Posts: 6
Joined: Sun Apr 23, 2023 10:19 am

Re: Async Websocket client

Postby sigma_shig » Wed May 17, 2023 4:47 am

Sure, I understand, that websocket has a loop under cover. It is ok, but I would like to work with this high-level "cover" to avoid any low-level work which requires a lot of effort. The same as we are using Arduino-ESP32 framework which has FreeRTOS+ESP-IDF under cover (which also has a machine codes under cover).

Who is online

Users browsing this forum: Bing [Bot] and 39 guests