Git Product home page Git Product logo

Comments (12)

chazzmoney avatar chazzmoney commented on September 26, 2024 1

Hmmm. Weird. I only have one for 1m candle, one for trades, and one for depth. I do initialize all three at once, but that seems like it shouldn't be too many...

from node-binance-api.

bkrypt avatar bkrypt commented on September 26, 2024 1

Hi guys, great API, thank you. Has definitely saved me a lot of time getting my project off the ground.

I recently ran into this 504 issue with the WebSocket streams, and realised the API doesn't take advantage of Binance's APIs combined stream endpoints. I've implemented their use in the following commit https://github.com/keith1024/node-binance-api/commit/aeb0d87c4ed5998ae7dd72fb35f47baf8319b9fe

This took me down from ~315 socket connections to 4 for the same amount of data, and eliminated all traces of the "unexpected response" errors. Check it out, let me know what you think. I'll open a PR if you're happy with it.

from node-binance-api.

jaggedsoft avatar jaggedsoft commented on September 26, 2024 1

@Keith1024 Yes, absolutely. I didn't know you could even do this, and it looks fantastic
I'll need to know if there are any breaking changes. If there are, we should increase the version number

Please issue pull requests to the development branch located at:
https://github.com/jaggedsoft/node-binance-api/ and they will be merged into binance-exchange shortly after. Full credit will be given. Thank you!

from node-binance-api.

bkrypt avatar bkrypt commented on September 26, 2024 1

@jaggedsoft Haha, I know what you mean, I also somehow missed the mention of combined streams in the docs until today. Excellent, I'll submit the PR first thing in the morning. I'd do it now, but it's 01h10 here at the moment and my brain is basically in bed already. No breaking changes, but will confirm in the PR.

from node-binance-api.

jaggedsoft avatar jaggedsoft commented on September 26, 2024

This commonly happens when you are trying to open too many websocket connections at once

Or if you are connected to many sockets and get disconnected, it tries to reconnect to them too fast

Both of these issues will be fixed automatically in a future release

from node-binance-api.

vaielab avatar vaielab commented on September 26, 2024

Hi there,
Is there a way to catch this error insted of making the app crash until this is fixed?

from node-binance-api.

jaggedsoft avatar jaggedsoft commented on September 26, 2024

Can you tell me if you are opening many websocket connections at once?
Does it show they are reconnecting when this happens?

from node-binance-api.

vaielab avatar vaielab commented on September 26, 2024

I have about 50 trades webconnections open, and the same amount of candlesticks open.
I try to open both of them with a delay (60sec) to help prevent this.
It will work for sometime, then simply crash with the same error.

Sometime I get an "WebSocket reconnecting:" message before crashing, but not always, and a lots of time, I'll get a "WebSocket reconnecting:" message and it will not crash.

I know the best solution would be as you said on the other github to have a delay on everything, but the official doc tell us that the status is unknown, so maybe we could just ignore it (display a message, or send a error message), and like nothing happend.

from node-binance-api.

jaggedsoft avatar jaggedsoft commented on September 26, 2024

Situations like chazzmoney's are the one I'm more concerned about. The automatic reconnection for 50+ websockets should be an easy fix.
Properly handling a 504 error appears to be easier said than done. Looking in to this

from node-binance-api.

jaggedsoft avatar jaggedsoft commented on September 26, 2024

@chazzmoney I believe keith1024 has solved this issue and improved the performance of this API overall drastically. Can you confirm?

from node-binance-api.

chazzmoney avatar chazzmoney commented on September 26, 2024

I've been running it for a couple hours and it seems to work well. I feel like the performance is slower, but I have no basis for that beyond the scroll speed on my terminal.

To fully verify that the problem does not occur again, I'll need to update my cloud server and then check the logs over the next few days. I'll call it good for now and if there is an additional problem I will re-open.

from node-binance-api.

amelenetwork avatar amelenetwork commented on September 26, 2024

Hello there .. Really I don't understand how we can catch ERRORS :(

I have no so much experience node.js too . I try this try-catch blocks , but Im getting 5045 somethings errors and cutting down process . I need to keep connection 24 hours .... if crash need re-connect self or script should work , not stooped . Anybody help me ?

Thank you ....

try{
}
catch(err){
}

from node-binance-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.