1

After some initial problems, I managed to get Jmdns up and running, which is discovering my Raspberry Pi connected to my network quite nicely. I'm using the example from this page.

However, I'm not really understanding the getPort() function. I assumed it would return the port that my Pi is on, which is 80 (according to the settings), but instead, it's returning a value of 9.

The IP address is correct, and so is the name, but the port doesn't seem right. Have I misunderstood?

If so, how can jmdns return the correct port number from my pi?

Any help would be appreciated. Thanks.

NREZ
  • 942
  • 9
  • 13

1 Answers1

0

http://home.heeere.com/tech-androidjmdns.html I think this is the link he/she meant.

Also, you will find you can't really use any port under 1024 without superuser permissions (you won't have these unless you've rooted your device). The API probably recognizes any port below 1024, while not a superuser, as 0 and therefore assigning a new port for you.

Ports under 1024 are considered "Privileged Ports."

Reference: Why are ports below 1024 privileged?

Community
  • 1
  • 1
Joey
  • 153
  • 1
  • 8