ccxws icon indicating copy to clipboard operation
ccxws copied to clipboard

Binance stops streaming

Open Albot15 opened this issue 3 years ago • 10 comments

Exchange Binance, Binance Futures

Subscription type Ticker

Describe the bug I noticed recently Binancea and Binance Futures stops streaming data randomly. I tested with ticker streaming (!ticker@arr) and if i restart it, then it start working again. However, it stops again after few hours.

Note: There is no error in console

I also tested aggTrade endpoint and it works great and not stoping at all.

Anyone experiencing similar issue?

Albot15 avatar Sep 13 '20 12:09 Albot15

Thanks for submitting an issue!

Any chance you see a disconnected event when this happens? There is a flag that checks if tickers are subscribed. It only get cleared during the closing event but not disconnected. I'm guessing this is an issue with the socket gets disconnected and when it reconnects it fails to resent the !ticker@arr message because the flag hasn't been cleared.

bmancini55 avatar Sep 16 '20 19:09 bmancini55

Thanks for the reply.

There is nothing in console log about disconnected event. Do i need to console any specific variable to monitor disconnects? If, yes please let me know which one.

Albot15 avatar Sep 17 '20 04:09 Albot15

You need to attach an event listener to the disconnected event:

client.on("disconnected", () => console.log("disconnected"));
client.on("reconnecting", () => console.log("reconnecting"));
client.on("connecting", () => console.log("connecting"));
client.on("connected", () => console.log("connected"));

bmancini55 avatar Sep 17 '20 15:09 bmancini55

Thanks, I will attach these events and let you know

Albot15 avatar Sep 17 '20 18:09 Albot15

Hi,

This time it took days to stop streaming and today i got printed console. disconnected reconnecting connecting connected reconnecting connecting connected reconnecting connecting connected

This keeps going and won't stop until i restart node.

Albot15 avatar Sep 24 '20 05:09 Albot15

Thanks for taking the time to capture this! Will hopefully have a fix in soon.

bmancini55 avatar Sep 30 '20 02:09 bmancini55

any updates here?

bifot avatar Sep 23 '21 08:09 bifot

hi there @bifot are those happening in sequence immediately one after the other ? I noticed there is no "disconnected" event apart from the first ? did you manage to find a solution or are you experiencing the same issue still ?

nileio avatar Jul 18 '22 10:07 nileio

Experience this issue as well

alanwu4321 avatar Oct 16 '22 23:10 alanwu4321

i'm not experiencing this issue anymore, just installed latest version of ccxws and everything is fine

one year ago i was experiencing this issue because sometimes i did unsubscribe before fetching all markets (and subscribe after as well) and request on fetch markets failed so subscribe didn't triggered

bifot avatar Oct 17 '22 06:10 bifot