4

I am currently doing some research for a project. The setup is simple, I have a computer running a service in my home network and any device connected to that same network should be able to discover the service automatically and use it. I have no specific technology requirement whether it is on the server or client side. The client knows about the service definition.

Other than that I have no idea what strategy to use, what technology to look at or whether I should go for a SOAP or a HTTP based service. I think going HTTP with REST API is the best for targeting all devices but I am opened to any suggestions.

Thanks.

Ucodia
  • 143
  • 4

1 Answers1

4

One of the simplest ways to achieve this is to use UDP broadcast. Essentially:

  1. The server listens for UDP packets on a certain port.
  2. When a client wants to connect to the server, it sends a broadcast UDP packet to the certain port.
  3. When the server sees a broadcast packet, it replies to that client with information about what the actual address/URL of the server is.

There are established standards that build upon this idea, for example mDNS.

Greg Hewgill
  • 10,181
  • 1
  • 46
  • 45
  • Thanks very much for that info. Sounds like a pretty good possibility. – Ucodia Jun 12 '14 at 00:27
  • Your clue lead me to chose UPnP which makes use of SSDP as a discovery protocol (http://en.wikipedia.org/wiki/Simple_Service_Discovery_Protocol). Of course that one is based on UDP broadcasting. Thanks again. – Ucodia Jun 18 '14 at 08:56