binance / binance/binance-futures-connector-java

how to solve "A single connection is only valid for 24 hours; expect to be disconnected at the 24 hour mark"

Open
#26 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
191
Forks
96
PR merge metrics
No merged PRs in 30d

Description

I have tried two solutions.
1.Restarting regularly

oldClient.closeAllConnections();
ThreadUtil.sleep(5000);
startBinanceWs(); // reconnect

But I got an error: the connection will enter onFailureCallback

2.I want to use the official website's method:
"Combined streams are accessed at /stream?streams=//&listenKey=
must be a valid listenKey when you establish a connection"
But it seems that it doesn't support.

Do you have any good solutions? I'm waiting for your reply online, thank you very much!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with startBinanceWs(), oldClient.closeAllConnections(), and the onFailureCallback path, then compare the connector’s WebSocket handling with the official combined-stream and listenKey description in the issue. Done should clearly establish how the 24-hour disconnect and reconnect flow are handled, including whether the documented listenKey form is supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.