binance-futures-connector-java
binance-futures-connector-java copied to clipboard
Feature proposal: client side websocket ping
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.