Closed Oozlum closed 2 years ago
Hi @Oozlum
That's true it'll try to connect and exit only after returning either true
or false
, as written in the example
You can turn on debug to display what's wrong with the connection (at which step), such as
#define _WEBSOCKETS_LOGLEVEL_ 4
Examples are just examples to demo the basic functions of the library. You have to modify the example, to use FreeRTOS multi-task or multi-thread to have non-blocking effect, for your special use-case.
As I don't spend time on this library anymore (unless fixing breaking bugs), I suggest you try to post the issue on ArduinoWebsockets library, on which this library is based, or Arduino Forum, to get better help.
Good Luck,
Looking at the example code:
bool connected = client.connect(websockets_connection_string);
it seems to me that connect() will block until the connection is made or fails. Is that correct? Is there any way to perform the connection in the background and use the event callback to detect connection?