Git Product home page Git Product logo

Comments (6)

thom-nic avatar thom-nic commented on July 17, 2024

Came across jmdns/jmdns#84 which gives some hints as to the cause.
It's probably originating here: https://github.com/mafintosh/multicast-dns/blob/master/index.js#L53-L55

Although I'm not clear as to why the OS is emitting the ENODEV error.

from bonjour.

thom-nic avatar thom-nic commented on July 17, 2024

As a stopgap, I think I can add the following to prevent the error event from crashing node:

b = bonjour();
b._server.mdns.on('error',err => console.error('mdns server', err));

EDIT: actually I don't think that will work as it looks like the socket gets bound as soon as the multicastdns instance is created... So it's a bit of a race whether the listener will be added before the socket.on('listening' callback gets fired where that error is being emitted.

This is starting to feel more like an issue in multicast-dns so I may move the issue report there.

from bonjour.

AMontagu avatar AMontagu commented on July 17, 2024

I have the same error only when bonjour start when my computer is not connected to a router.
Prevented by checked if there is a connection to a router before requiring bonjour.

If this is possible to have correct handler or a correct way to prevent this error and you find it please tell me :).

from bonjour.

thom-nic avatar thom-nic commented on July 17, 2024

Prevented by checked if there is a connection to a router before requiring bonjour.

Can you provide a code snippet? Do you enumerate os.networkInterfaces() and look for one with a gateway?

from bonjour.

AMontagu avatar AMontagu commented on July 17, 2024

Hello ! No I am on a multi process architecture with already a python process that manage all the connection task. I just ask it to give me the current connection state.

Sorry I am not able to give you some code snippet in node.

from bonjour.

thom-nic avatar thom-nic commented on July 17, 2024

No problem. But this follows what I saw - it happened when I had a link-local address and no gateway. The problem is, Bonjour is designed to work in link-local environments without DNS/DHCP! :(

The core of the issue is clearly OS-level behavior, but I wish I could understand exactly why/ under what conditions exactly so I can best determine how to work around the issue.

from bonjour.

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.