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

SubscribeToAllTickerUpdatesAsync not call after REST calls #1046

Open
diegoaraujolima opened this issue Apr 1, 2022 · 16 comments
Open

SubscribeToAllTickerUpdatesAsync not call after REST calls #1046

diegoaraujolima opened this issue Apr 1, 2022 · 16 comments

Comments

@diegoaraujolima
Copy link

After making a candlestick REST call, Socket data is no longer received consistently. Even making the call to UnsubscribeAllAsync, it is intermittent, sometimes it receives and sometimes it doesn't.

@diegoaraujolima
Copy link
Author

How i keep socket alive? What a method? Not found KeepAlive().

@mange-ess
Copy link

@diegoaraujolima there is a function KeepAliveUserStreamAsync which you call, for example in the BinanceClient.UsdFuturesApi.Account interface.

@diegoaraujolima
Copy link
Author

OK. But what is this listenKey parameter?

@diegoaraujolima
Copy link
Author

Are you sure? Wouldn't the listenKey be the return key of the StartUserStreamAsync method?

@diegoaraujolima
Copy link
Author

Is this serious? I think you confused when you said which method returns the listenKey. I just corrected what you said, because Subscribe doesn't return the listenKey, but an integer id, which is for another purpose.

@diegoaraujolima
Copy link
Author

Yes, that I know, I already use it that way. The problem is not that. I have a socket to get the price using the SubscribeToAllTickerUpdatesAsync() method and every close of 1 minute, 1 hour, 4 hours and 1 day candles and then iterate on all symbols to get the candles and calculate the RSI of all candle closes. In some cases the candle calls stop responding and in some cases it is the socket that stops receiving messages.

@diegoaraujolima
Copy link
Author

In fact, from what I'm checking it could be an excessive amount of calls on Binance. While I have these threads picking up the candles, after that I generate some orders on Binance for several currencies and it seems that when there is a delay in the response in the order API, some threads are blocked waiting for the completion of others. It seems to me more of a problem of managing concurrent threads than in fact a problem of the library. I'll double check and if I find a problem with the library I'll bring it here again. Thanks for listening.

@diegoaraujolima
Copy link
Author

Is it possible to set a timeout for REST API requests?

@JKorf
Copy link
Owner

JKorf commented Jul 31, 2022

I'm sorry, this issue got kinda burried. You can use the RequestTimeout in the client options to set the request timeout

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

4 participants
@JKorf @diegoaraujolima @mange-ess and others