Closed InTheta closed 5 years ago
Hello,
it seems that we are able to call up to 50 subscribe requests on the one websockets connection.
So the solution seems to create more BitfinexWebsocketCommunicator
and BitfinexWebsocketClient
.
I would prefer to leave it up to the client to handle that situation and just provide good error message from library.
Usage example:
public async Task<BitfinexWebsocketClient> CreateClient(Action<BitfinexWebsocketClient> subscribeAction)
{
var communicator = new BitfinexWebsocketCommunicator(url);
var client = new BitfinexWebsocketClient(communicator);
client.Streams.InfoStream.Subscribe(info =>
{
Log.Information($"Info received, reconnection happened, resubscribing to streams");
subscribeAction(client);
});
await communicator.Start();
}
var client1 = CreateClient(client => {
client.Send(new TickerSubscribeRequest("BTC/USD")).Wait();
//... up to 50x
});
var client2 = CreateClient(client => {
client.Send(new TickerSubscribeRequest("ETH/USD")).Wait();
//... up to 50x
});
I will prepare some better error message for that new rate limit.
http://blog.bitfinex.com/api/api-update-september-2018/
"As of September 1st, every WebSocket connection will have a limit of 50 subscriptions to market data feed channels (tickers, book, candles, trades, …)."
They are already rolling this out, as I have spent 2 day debugging thining I have a threading issue, but its actually this.
How can we fix this?
Split the pairs into groups?
Here is a log with the errors i'm receiving https://pastebin.com/vcLy9SpL (log dump with errors)