If you want to create an application that discovers other hosts running it on the same network ...
You can simply send UDP Broadcast to a specific port, all running instances of your application on the network can listen to this port and respond with a message identifying them as a host!
source share