Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

JMDNS - IP and Port numbers

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello. I'm a little stuck in a project I'm making for my Android phone. The project is a simple controller for my Raspberry Pi running XBMC. What I'm trying to do is send some play, pause, next, etc commands to it via http, using the XBMC JSON API.

At the moment, I can send the commands with no problem. However, my method already assumes I know the IP and Port number of the Pi. For example, this command will send XBMC to the home screen:



As you can see, the Port number is 80. But what if someone else has a different ip and port number? It won't work. So, what I'm trying to do is use the JMDNS library to locate my Pi on the wi-fi network, thus saving the user the hassle of manually typing in the IP and Port. But, for some reason the JMDNS library is returning this address:

192.168.0.103:9

Port number 9? What's port number 9? It should be 80. And I can't understand why it isn't. The code obviously works because the IP and hostname are both correct, but this port 9 is really confusing me.

So, I guess my question is this: Does anyone here have any experience with JMDNS and zeroconf on the Android, and also, why wouldn't it return port 80 as expected?
 
Wink, wink, nudge, nudge, say no more, it's a tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic