Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature proposal: client side websocket ping #13

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

gawronA
Copy link

@gawronA gawronA commented Mar 29, 2023

Hello, this PR is my feature proposition.

Currently this library is not able to detect lost connection with Binance Websocket API.

I have exposed pingInterval attribute of OkHttpClient as optional parameter for UM/CMWebsocketClientImpl to be set by user accordingly to needs. This issues the client to send ping frames to Binance Websocket API and await pong response. When connection is lost (e.g. due to Wi-Fi/Internet disconnection), onFailureCallback will be triggered after at most pingInterval.

Please let me know if this change fits. I'm open to comments and suggestions.

@2pd
Copy link
Contributor

2pd commented Jun 8, 2023

Thanks for the PR, we will have a review

@0xenAlpha
Copy link

any update on this we're having the same issue.

@panpeter
Copy link

Any chance someone from the Binance team could review and merge it soon? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants