Closed fredfortier closed 4 years ago
I see that there is a keep_alive
method in UserStream
. Is the idea that I should periodically call this method on a separate thread? Any pointers on how to properly use this method would be appreciated.
@fredfortier Yes, it should be called periodically, see the link below
https://binance-docs.github.io/apidocs/spot/en/#listen-key-spot
Keepalive a user data stream to prevent a time out.
User data streams will close after 60 minutes.
It's recommended to send a ping about every 30 minutes.
I tested this overnight and confirm that it works.
I'm subscribing to the WS user stream as per the "WEBSOCKETS - USER STREAM" section of the README. I noticed that it seems to disconnect (no longer receiving updates) after several hours. I also subscribe to the
!ticker@arr
stream in the same connection (like this:format!("{}/!ticker@arr", answer.listen_key)
) but the ticker stream stays connected.Where do you suggest I begin troubleshooting this?