binance / binance-futures-connector-java

MIT License
126 stars 65 forks source link

WebSocket Connection State / Error on new connection for UMWebsocketClientImpl #20

Open TSemenchuk opened 1 year ago

TSemenchuk commented 1 year ago

We have no any information about the connection state for the UMWebsocketClientImpl. According to the description (https://binance-docs.github.io/apidocs/futures/en/#websocket-market-streams) all web sockets might be closed in 24 hours. Even if we try to make new instance of the class UMWebsocketClientImpl we will receive the following error:

[BINANCE_STREAMS_MANAGER] ERROR com.binance.connector.futures.client.utils.WebSocketConnection - [Connection 6] Failure java.io.InterruptedIOException: executor rejected at okhttp3.internal.connection.RealCall$AsyncCall.executeOn(RealCall.kt:501) at okhttp3.Dispatcher.promoteAndExecute(Dispatcher.kt:184) at okhttp3.Dispatcher.enqueue$okhttp(Dispatcher.kt:125) at okhttp3.internal.connection.RealCall.enqueue(RealCall.kt:164) at okhttp3.internal.ws.RealWebSocket.connect(RealWebSocket.kt:165) at okhttp3.OkHttpClient.newWebSocket(OkHttpClient.kt:281) at com.binance.connector.futures.client.utils.WebSocketConnection.connect(WebSocketConnection.java:52) at com.binance.connector.futures.client.impl.WebsocketClientImpl.createConnection(WebsocketClientImpl.java:719) at com.binance.connector.futures.client.impl.WebsocketClientImpl.klineStream(WebsocketClientImpl.java:167) at com.binance.connector.futures.client.impl.WebsocketClientImpl.klineStream(WebsocketClientImpl.java:149)

Steps to reproduce:

UMWebsocketClientImpl client = new UMWebsocketClientImpl(); client.klineStream(); client.closeAllConnections(); Thread.sleep(5000); //We should wait some time here because the method is not sync if I understood correctly client = new UMWebsocketClientImpl(); client.klineStream(); //Error here

TSemenchuk commented 1 year ago

Probably the issue is connected with this one feature request: https://github.com/binance/binance-futures-connector-java/pull/13

CryptoCosmicDev commented 8 months ago

@TSemenchuk Please assign this issue to me.