I have little experience in network programming and I am writing a multi platform system which requires each device to be able to find other devices within the same LAN. I am looking for the right approach to do that, and hope that people here can give a good advise. Here are my design requirements:
I am using C++ and the solution needs to be cross platform, which is at least able to run on iOS, Windows, Android.
The system should be pretty light weight, and work under no special setup or network requirements, if possible.
Here are different approaches I am considering:
Using uPnP protocol, but I am not very familiar with it, and it doesn't seems that there are many examples with code on the subject.
Using the traditional socket approach, creating both Server/Client on each device and send the data packet to every IP in the LAN. And do everything manually afterwards. Correct me if I am wrong, if I send a packet to the broadcast address, does that mean that the system automatically sends my packet to every IP within the subnet?
Using an external server all clients will register to, and then getting information about other(already registered) clients from that server. However, I am not sure with what information each client should connect in order to determine they are in the same LAN.
Let me know if what I am thinking makes any senses. Any advice is greatly appreciated.