I want to implement in my program functionality, which will make it able to discover hosts running the same application in local network. To do this I will open in my program an UDP socket and join multicast group at address 224.0.0.1 (when using IPv4) or ff02::1 (when using IPv6). Then I’m going to notify other hosts, that I’m just logged in to this network. I have two question according to my idea:
- Is it right way to do this or maybe there are better solutions?
- What’s the common policy about using multicast communication in local networks (e.g. hot-spots)? Is it usually possible or most routers block or even doesn’t support multicast communication at all?
I develop my appliaction in C++ for Linux, in future I’m ging to write version for Windows in C#.
That’s usually your best option. The other option would be UDP broadcast, but there’s no guarantee of delivery, so you have to broadcast at a regular interval to make sure the other applications hear it.
As far as policy, I just checked my Linksys Wifi access point, and it had multicast disabled by default. I suspect a lot of places run in this default configuration