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

Detect services on two interfaces? #68

Open
RichardFoss opened this issue Oct 14, 2020 · 2 comments
Open

Detect services on two interfaces? #68

RichardFoss opened this issue Oct 14, 2020 · 2 comments

Comments

@RichardFoss
Copy link

I'm using Windows 10 and I would like to detect services on an Ethernet interface and wireless interface. I have an audio device that can be connected directly to my computer or can be connected to a wireless router. However, I have problems when the npcap loopback adapter is enabled. So I would like to avoid attempting to find services on that. Is there a way to use the interface option to detect on two interfaces?

@ambienthack
Copy link

ambienthack commented Jun 17, 2022

Some details on th issue. My understanding is that the problem comes from this line:

          socket.setMulticastInterface(opts.interface || defaultInterface())

While the socket listens to multiple interfaces, it send the discovery request to a single interface. So, devices attached to the other interfaces don't respond to the request.

I'm not familiar with the socket programming. Googling suggests two possible solutions (not sure which one is the orthodox one):

  1. When sending a message, consecutively call socket.setMulticastInterface(iface); and socket.send(...) for every interface.
  2. Have one socket per interface of interest.

@RichardFoss
Copy link
Author

Thank you very much for your help, much appreciated! The question was some time ago, and looking back to my code, I see that I moved on and used the mdns package for Apple, and the bonjour package for Windows in order to pick up services.

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