dmikushin / binance-cxx-api

Binance Bincoin Exchange C++ API
MIT License
66 stars 42 forks source link

wsi-timeout scheduling validity check #12

Closed mussonero closed 4 years ago

mussonero commented 4 years ago

I have a strange issue here, almost after 24 hours of running my program using

Websocket::enter_event_loop()

I do not receive any more "wsi scheduling validity check" in program syslogs. Therefore the program does not get any update from Binance ticker which I set-up. I was wondering if anyone else has this kind of behavior.

dmikushin commented 4 years ago

Interesting. Could you please share a test case with us? Provided a test case, I can test it myself.

mussonero commented 4 years ago

Hello!, At the moment i do not have a sample test , but i have googled around and i found it is a common issue for other languages, No data received by WebSocket after certain amount of time for an example Java Binance Api

And

A single connection to stream.binance.com is only valid for 24 hours; expect to be disconnected at the 24 hour mark

Quoted from Binance official API doc

i do not understand this point expect to be disconnected ???

dmikushin commented 4 years ago

I roughly remember this issue, but could not find its handling in my code. Yes, I think every 24 hours the connection is getting silenced. The solution is to drop the connection and reconnect back. Binance just wants to cut down long-hanging listeners, because 2-3 arbitrages a day should already be enough to become a billionaire.

mussonero commented 4 years ago

Actually this is what i am trying do right now, to cut off the connection every 12 hours and see how it goes.

dmikushin commented 4 years ago

This has been addressed in #13 for now.