Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Expose WebSockets for graceful closing #47

Closed
wants to merge 1 commit into from

Conversation

mcourteaux
Copy link

Binance disconnects after 24 hours of websocket streaming. To prevent this, we should be able to open a new websocket, and switch over to the new one, before the 24h mark. After the live switchover, we need to be able to close the original one. Exposing the okhttp.WebSocket allows us to perform: .close().

@big-andy-coates
Copy link

big-andy-coates commented Jan 25, 2018

Agreed. The ability to shutdown web sockets is also covered by #49, with more besides.

I chose not to expose the full web socket, as I felt that broke encapsulation, so instead I just return a Closeable. Though this has the downside that you only have a simple close call, rather than the choice of close or cancel. Could expose both if needed.

@mcourteaux
Copy link
Author

Not using this anymore. Using #49 instead.

@mcourteaux mcourteaux closed this Feb 2, 2018
skrser added a commit to skrser/binance-java-api that referenced this pull request Apr 26, 2021
skrser added a commit to skrser/binance-java-api that referenced this pull request Jul 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants