Coder Social home page Coder Social logo

Comments (4)

Marfusios avatar Marfusios commented on May 27, 2024

Hello,

thanks for the message.
I found the mistake, which caused the issue, it should be fixed now (version >= 0.0.8).
I wanted to provide an optional possibility for user/developer to adjust native .NET websocket client (ClientWebSocket), so it was reusing the instance (really bad idea..), now it's solved by factory method. Example:

var wsClientFactory = () => new ClientWebSocket()
            {
                Options =
                {
                    KeepAliveInterval = new TimeSpan(0, 0, 0, 10),
                    Proxy = ...
                }
            };
using (var communicator = new BitfinexWebsocketCommunicator(url, wsClientFactory))
{
    ...
}

I also used an idea from your closed PR (about lowering timeout for that built-in reconnect policy).
Check if it works, please.

from bitfinex-client-websocket.

dendle avatar dendle commented on May 27, 2024

Hi mate,

No problem - will deploy it tonight and see what happens.

Out of curiosity, were you getting the websocket connection getting closed due to inactivity, too?

Cheers,
Matt

from bitfinex-client-websocket.

dendle avatar dendle commented on May 27, 2024

Hello Marfusios,

The fix certainly helped avoid the error caused by re-using the disposed websocket, but I still get disconnected, as below:

INF XRPUSD - last price: 1.3475 INF XRPUSD - STDEV 0.00266565286861575 INF BTCUSD - last price: 11367 INF BTCUSD - STDEV 27.6592381381964 INF XRPUSD - last price: 1.347 INF XRPUSD - STDEV 0.00266654664123795 INF BTCUSD - last price: 11355 INF BTCUSD - STDEV 27.650912481618 INF [BFX WEBSOCKET COMMUNICATOR] Last message received 1.27731436333333 min ago INF [BFX WEBSOCKET COMMUNICATOR] Last message received 2.27731651 min ago INF [BFX WEBSOCKET COMMUNICATOR] Last message received 3.277320265 min ago INF [BFX WEBSOCKET COMMUNICATOR] Last message received more than 3 min ago. Hard restart.. INF [BFX WEBSOCKET COMMUNICATOR] Reconnecting... INF [BFX WEBSOCKET COMMUNICATOR] Last message received 1.82136661 min ago INF [BFX WEBSOCKET COMMUNICATOR] Last message received 2.82137791666667 min ago INF [BFX WEBSOCKET COMMUNICATOR] Last message received 3.82134397166667 min ago INF [BFX WEBSOCKET COMMUNICATOR] Last message received more than 3 min ago. Hard restart.. INF [BFX WEBSOCKET COMMUNICATOR] Reconnecting... INF [BFX WEBSOCKET COMMUNICATOR] Last message received 1.82126731666667 min ago INF [BFX WEBSOCKET COMMUNICATOR] Last message received 2.82121636166667 min ago INF [BFX WEBSOCKET COMMUNICATOR] Last message received 3.82120505333333 min ago INF [BFX WEBSOCKET COMMUNICATOR] Last message received more than 3 min ago. Hard restart.. INF [BFX WEBSOCKET COMMUNICATOR] Reconnecting...

from bitfinex-client-websocket.

dendle avatar dendle commented on May 27, 2024

Think I have a plan on how to fix, will test and raise a PR if it works....

from bitfinex-client-websocket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.