Marfusios / bitfinex-client-websocket

🛠️ C# client for Bitfinex & Ethfinex websocket API version 2.0
Apache License 2.0
55 stars 38 forks source link

Subscriptions persist across reconnects &simplified client/communicator #8

Closed dendle closed 6 years ago

dendle commented 6 years ago

Hello Marfusios,

I had trouble with subscriptions being lost after a reconnect - In this PR i made it the communicators responsibility to re-send subscriptions in reconnect - this prompted me to also change the surface of the client - not sure if you like this way of doing things, but it seemed to make things cleaner in my head.

Cheers, Matt

dendle commented 6 years ago

It might be luck, but this version is the first version that has remained connected for over 24hrs. By remained connected, I mean that it it continued streaming tickers after a reconnect occured - the only missing data was when the timeouts were waiting to kick in.

henningms commented 6 years ago

Can this be achieved without removing the Communicator as a constructor dependency?

Marfusios commented 6 years ago

Hello, thanks for the PR, but unfortunately I can't merge it. It is too much groundbreaking and it removes the open-closed principle - adding a new request (api coverage) shouldn't force to modify existing code.

Please try the latest version of the library, reconnection should work correctly. And resubscribing to channels should be handled by client, see #12