Binance.Net icon indicating copy to clipboard operation
Binance.Net copied to clipboard

Spotstream.SubscribeToAllSymbolTickerUpdatesAsync

Open M22arius494 opened this issue 2 years ago • 3 comments

Describe the bug After updating to v8 I get this error. It wasn't in previous V7 so I assume its the library (but not sure if that is really correct)

To Reproduce socketClient.SpotStreams.SubscribeToKlineUpdatesAsync(symbols .... ) Where symbols is the FULL set of BTC, BUSD, USDT coins. This full set can be over 300 symbols (seperated by BTC/USDT etc)

Expected behavior I expect this to work like the V7 enige, but instead I get an error "No response on subscription request received"

[Quick Fix] For now i have a quick fix by reducing the amount of symbols. But that is not an technical answer why this problems occurs

M22arius494 avatar Feb 28 '22 09:02 M22arius494

Hi, I was just looking at this. You should be able to get this to work when you increase SocketResponseTimeout to 30 seconds. It does however take some time to finish the subscription. It seems like when you sent more than 4000 bytes to the server over the socket Binance takes 10s to process, which happens again if you sent over 8000 bytes. Previously this was no issue as the subscription details were sent in the URL, where now they get sent over the socket. I'll be contacting Binance over this strange behavior. Here's some test results:

Bytes send in subscribe request -> Response time
313 bytes -> 260 ms
859 bytes -> 260 ms
1966 bytes -> 260 ms
3907 bytes -> 260 ms
4180 bytes -> 10s
5545 bytes -> 10s
7759 bytes -> 10s
8335 bytes -> 20s
11155 bytes -> 20s
22195 bytes -> 30s + error (too many subs)

JKorf avatar Feb 28 '22 09:02 JKorf

So I've had contact with Binance over this, see https://dev.binance.vision/t/socket-live-subscribing-server-delay/9645 It might be an issue in the dotnet ClientWebsocket implementation which is used in this library. I'll see if I can get someone to look into this on the dotnet repo

JKorf avatar Mar 01 '22 07:03 JKorf

For reference, I've opened an issue on the dotnet repo: https://github.com/dotnet/runtime/issues/65998 There doesn't seem to be a lot of interest in this though.

JKorf avatar Mar 18 '22 12:03 JKorf