Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closing one WebSocket connection inadvertently closes another #900

Open
vladimir-cloudypro opened this issue Oct 4, 2023 · 0 comments
Open

Comments

@vladimir-cloudypro
Copy link

vladimir-cloudypro commented Oct 4, 2023

Description:

When utilizing two separate WebSocket connections (trades and bookTickers), terminating one with binance.websockets.terminate(pair) causes the other to close as well, despite them being distinct. Additionally, this behavior is observed even when the node-binance-api.js file is duplicated and used separately for each WebSocket.

Steps to Reproduce:

  1. Initialize two separate WebSocket connections: one for trades and one for bookTickers.
  2. Use distinct instances of node-binance-api.js for each WebSocket.
  3. Terminate one of the WebSocket connections using binance.websockets.terminate(pair).
  4. Observe that the other WebSocket connection also closes.

Expected Behavior:

Terminating one WebSocket should not affect the other, especially when they are managed by separate instances of node-binance-api.js.

Actual Behavior:

Terminating one WebSocket connection leads to the inadvertent closure of the other.

Environment:

Node version: 18.18.0
Library version: node-binance-api v0.13.0
OS: macOS 12.7

Additional Information:

Both WebSocket connections are set up and managed independently.
The issue persists even after ensuring separate event handlers for each connection.
I'm closing the websocket using binance.websockets.terminate(pair)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant