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

Reconnect not working #12

Closed
andrzej-suwala opened this issue Mar 13, 2018 · 2 comments
Closed

Reconnect not working #12

andrzej-suwala opened this issue Mar 13, 2018 · 2 comments

Comments

@andrzej-suwala
Copy link

Hi,

Thanks for all your good work.
I've compiled your console sample, and reconnecting is not working.
Please take a look at screenshot
https://ibb.co/gYDdUc

I've run the app, disconnected internet cable, waited 30 sec. and reconnected the cable.
Internet is working, but the app didn't reconnect.

@Marfusios
Copy link
Owner

Hello,

it seems to me, that you are not resubscribing to channels, hence you don't get any new messages and it invokes a new reconnecting.

You should handle info message and authentication message and then resubscribe, example:

client.Streams.InfoStream.Subscribe(info =>
{
    Log.Information($"Reconnection happened, Message: {info.Msg}, Version: {info.Version}");
    client.Authenticate(API_KEY, API_SECRET);
});

client.Streams.AuthenticationStream.Subscribe(auth =>
{                    
    Log.Information($"Authenticated: {auth.IsAuthenticated}");

    client.Send(new TradesSubscribeRequest("BTC/USD"));
    client.Send(new CandlesSubscribeRequest("BTC/USD", BitfinexTimeFrame.OneMinute));
    client.Send(new BookSubscribeRequest("BTC/USD", BitfinexPrecision.P0, BitfinexFrequency.TwoSecDelay));
});

communicator.Start().Wait();

@andrzej-suwala
Copy link
Author

Thank you, I'll try it.

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

2 participants