Giter VIP home page Giter VIP logo

Comments (3)

jonathan-roy avatar jonathan-roy commented on August 28, 2024 1

Thank you for your answer @reqshark. Graceful reconnection attempts are a good thing but I think that an optional maximum number of reconnection attempts which, once reached, gives an error, could be interesting. This way, the UI or client can have a clue that something is not correctly working (take as an example an attempt to connect to an unknown host).

from node-nanomsg.

reqshark avatar reqshark commented on August 28, 2024

@jonathan-roy, the steam error event is the right way to detect stream errors associated any normal stream communication errors in node. however, when we wrote this module, we never thought to emit connection or other errs from the clib layer correctly (in the idiomatic node way that you're referencing).

I'm open to review a PR request if you would like to take stab at fixing this. You would need to make sure to call Socket's emit('error', withSomethingAboutIt). It's an important feature that we're lacking so I'm flagging this as a feature request instead of considering it a bug in our module (it's more of a bug).

from node-nanomsg.

reqshark avatar reqshark commented on August 28, 2024

what exact type of connection error are you trying to detect?

Is there a way to detect connection/communication errors?

there's no way to detect disconnect.

sometimes Node.JS TCP/HTTP or other TCP libraries will consider an unexpected client disconnect as "connection error". These connection "errors" are deliberately ignored by the library and sockets are designed to gracefully attempt reconnections without surfacing anything like err to application

from node-nanomsg.

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.