There is a new function provide_websocket_with_retry(...) which takes as second argument the number of milliseconds after which it tries to reconnect again. In this function, after creating the websocket object, it checks if the websocket has really been created and then adds an error handler to the websocket, which activates a timeout.
After the timeout has exceeded a new inner websocket is created, which inherits all settings from the old inner websocket, including all handlers like the message an error handler. In case the new websocket cannot connect, the error handler is invoked again and activates another timeout.
In this PR a retry timeout is added.
There is a new function
provide_websocket_with_retry(...)
which takes as second argument the number of milliseconds after which it tries to reconnect again. In this function, after creating the websocket object, it checks if the websocket has really been created and then adds an error handler to the websocket, which activates a timeout.After the timeout has exceeded a new inner websocket is created, which inherits all settings from the old inner websocket, including all handlers like the message an error handler. In case the new websocket cannot connect, the error handler is invoked again and activates another timeout.