You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the best way to reconnect after a disconnect or some error?
I tried the following but doesn't appear to be working.
void onEventsCallback(WebsocketsEvent event, String data) {
if(event == WebsocketsEvent::ConnectionClosed) {
client.connect("wss://ws-feed.pro.coinbase.com");
client.send("{"type": "subscribe","product_ids": ["BTC-USD"],"channels": ["ticker"]}");
}
Instead is there any way to check if the connection is active in the loop() and reconnect from there?
The text was updated successfully, but these errors were encountered:
What is the best way to reconnect after a disconnect or some error?
I tried the following but doesn't appear to be working.
void onEventsCallback(WebsocketsEvent event, String data) {
if(event == WebsocketsEvent::ConnectionClosed) {
client.connect("wss://ws-feed.pro.coinbase.com");
client.send("{"type": "subscribe","product_ids": ["BTC-USD"],"channels": ["ticker"]}");
}
Instead is there any way to check if the connection is active in the loop() and reconnect from there?
The text was updated successfully, but these errors were encountered: