When i was using binance-futures-connector-java My WebSocket connection will be disconnected after one minute.
What should i do
Could you please provide a few more details of the issue, for example error log, etc.
java.io.EOFException: null
this is the exception when after 1 minute connection
looks like been closed by peer
我也遇到了同样的问题
我也遇到了同样的问题
这是报错信息
//账户信息推送
return websocketClient.listenUserStream(jsonListenKey.getString(“listenKey”), ((event) → {
log.info(“账户信息推送:[{}]”, event);
JSONObject eventJson = JSON.parseObject(event);
switch (eventJson.getString(“e”)) {
case “ORDER_TRADE_UPDATE” → jsonObject.set(orderTradeUpdate(eventJson));
case “ACCOUNT_UPDATE” → jsonObject.set(accountUpdate(eventJson));
}
}));
java.io.EOFException: null
at okio.RealBufferedSource.require(RealBufferedSource.kt:199)
at okio.RealBufferedSource.readByte(RealBufferedSource.kt:209)
at okhttp3.internal.ws.WebSocketReader.readHeader(WebSocketReader.kt:119)
at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.kt:102)
at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.kt:293)
at okhttp3.internal.ws.RealWebSocket$connect$1.onResponse(RealWebSocket.kt:195)
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)