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

Strange usage of INADDR_ANY #38

Open
hmeerlo opened this issue May 17, 2015 · 4 comments
Open

Strange usage of INADDR_ANY #38

hmeerlo opened this issue May 17, 2015 · 4 comments

Comments

@hmeerlo
Copy link

hmeerlo commented May 17, 2015

I don't understand these lines of networking.js:

  if (this.INADDR_ANY) {
    this.createSocket(index++, 'pseudo multicast',
      '0.0.0.0', 5353, this.bindToAddress.bind(this));
  }

Apperently when the INADDR_ANY option is set then another dgram socket is created on port 5353. But don't you always need this socket? If I don't set the option then mdns-js never receives any DNS responses, apparently because the responses are sent to port 5353 which is not listened on? So I changed the construction of networking in index.js to:

var networking = new Networking({INADDR_ANY:true});

And now all the discovery works for me again...

@kmpm
Copy link
Collaborator

kmpm commented May 30, 2015

There seem to be some differences on how INADDR_ANY is used on windows/mac.
By default it will listen to each individual interface and on that interface IP.
For some use cases that have not been enough and it will need to listen on all interfaces using INADDR_ANY as well.

It would be really nice to figure out what goes where and WHY.

What OS do you have, and version preferably?

@hmeerlo
Copy link
Author

hmeerlo commented May 31, 2015

Hi @kmpm, I am on OS X 10.10.3

@kmpm
Copy link
Collaborator

kmpm commented Sep 3, 2015

Changed default to use INADDR_ANY = true in 7f2406a

@mikakaraila
Copy link

Great,
I will test tomorrow. I just arrived back to home from Luleå.
We are trying to get also other records:
PTR, SRV and TXT to reply.
But lets check this next week with some emails.

Br,
Mika
3.9.2015 19.43 "Peter Magnusson" [email protected] kirjoitti:

Changed default to use INADDR_ANY = true in 7f2406a
7f2406a


Reply to this email directly or view it on GitHub
#38 (comment).

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

3 participants