python-binance icon indicating copy to clipboard operation
python-binance copied to clipboard

[Update]: Websocket client inconsistency issue

Open wiseinvoker opened this issue 5 years ago • 1 comments

There are several method in Binance Socket Manager to subscribe klines, tickers, etc. I think the websocket functionality is inconsistent and sometimes it raises Maximum connection reached error when trying to subscribe websocket streams while other websocket client (using websocket-client) connection to the Binance Stream works very well. If I subscribe Binance websocket stream using JavaScript in browser, it never raises maximum connection reached error. But If I use this library python-binance to subscribe kline or ticker stream, I sometimes face maximum connection reached error.

Using python-binance

conn_key = bm.start_kline_socket('BNBBTC', process_message, interval=KLINE_INTERVAL_1MINUTE)
conn_key = bm.start_multiplex_socket(['bnbbtc@aggTrade', 'neobtc@ticker'], process_m_message)

Using websocket-client

ws = websocket.WebSocketApp("wss://stream.binance.com/ws/btcusdt@kline_1m", on_message=on_message)
ws.run_forever()

Why not using websocket-client module to manage binance websocket streams?

wiseinvoker avatar Mar 08 '21 07:03 wiseinvoker

There are limits set by binance: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/wiki/Binance-websocket-endpoint-configuration-overview

Jex.com allows only 10 subscriptions...

So i guess thats not a fault of this lib!

oliver-zehentleitner avatar Apr 15 '21 06:04 oliver-zehentleitner