binance / binance/binance-futures-connector-python

Need a callback to recover from WebSocketConnectionClosedException

Open
#120 10 comments 1 reaction 0 assignees View on GitHub
Reviewing
Dominant language
Python
Stars
1.2k
Forks
326
PR merge metrics
No merged PRs in 30d

Description

In `binance/websocket/binance_socket_manager.py`, when `WebSocketException` is caught and identified as `WebSocketConnectionClosedException`, it logs that websocket connection is lost.

However in that case, I haven't been able to identify a flow where a `on_close` or `on_error` callback is triggered, so that it can be handled in the application code, in order to re-establish the websocket connection.

Any help regarding this would be highly appreciated. Thanks

Contributor guide

No contributing guide indexed for this repository

Research direction

Read binance/websocket/binance_socket_manager.py, focusing on the WebSocketException handling and the path for WebSocketConnectionClosedException. Trace how on_close and on_error are dispatched, then verify that an application can receive a callback when the connection closes and use it to re-establish the websocket.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.