-
Notifications
You must be signed in to change notification settings - Fork 146
Websocket inconsistency #71
Comments
you have inspired me to add a |
I believe what you want is this: for ( let endpoint of endpoints ) {
console.log(endpoint);
} edit: might not work |
strange, cause i just now used your repro steps as they are and this was the output in my system: |
Try |
logging endpoints gives using 'of' instead of 'in' just throws an error |
I'm sorry but I'm really at a loss here candlesticks: function candlesticks(symbols, interval, callback) {
for ( let symbol of symbols ) {
let reconnect = function() {
if ( options.reconnect ) candlesticks(symbol, interval, callback);
};
subscribe(symbol.toLowerCase()+'@kline_'+interval, callback, reconnect);
}
}, Essentially all it's doing is this: let symbols = ['BTCUSDT'];
for ( let symbol of symbols ) {
console.log(symbol);
} |
I'm adding |
Maybe you can try the |
chart shows the same behavior and also seem to use the same endpoint @kline_1m |
sorry, some more info about this: after closing and restarting nw.js, i cannot reproduce this one either. those zombie websockets seem to have been created at some point last night after the websocket was reconnected, but i can't tell exactly how or when. Let's keep this closed and I'll post more info once I have new details. Thanks! |
The verbose flag sounds like a really good idea! |
Never heard of nw.js, it allows you to use this from the browser or what? |
It used to be called node-webkit, it's basically chromium + node and enables users to turn html5 into cross-platform executables among other things. Similar to electronjs I guess (I want to try that one soon). |
sweet thanks, keep me updated if you have any problems etc |
thank you! |
Now I can definitely reproduce the issue. class Tester { let myTester = new Tester(); |
This project is only designed for node js. I can not afford to research what I would need to do to make it work with nwjs or electron |
Hi Jaggedsoft, please try saving the code from my previous comment as test.js, place it in some folder where you can install 'node-binance-api' via npm, then run "node test.js". I just did it and i can repro the issue using node v8.9.4 (same results as nw.js). |
I cannot reproduce this |
Hello,
I've just noticed that, after subscribing to the candlestick websocket (for example) for symbol 'BTCUSDT' the library seems to subscribe to a websocket for each letter.
In order words, when listing all websockets 60 seconds (with a timeout) after subscribing them, this is what is shown:
ws subscription:
binance.websockets.candlesticks(['BTCUSDT'], '1m', (candlestickData) => { });
ws listing after 60 seconds:
let endpoints = binance.websockets.subscriptions();
for ( let endpoint in endpoints ) {
console.log('' + endpoint);
}
console output:
btcusdt@kline_1m
b@kline_1m
t@kline_1m
c@kline_1m
u@kline_1m
s@kline_1m
d@kline_1m
(tested on 0.4.8)
The text was updated successfully, but these errors were encountered: