Sounds perfect for what I want. Thank you.
Karthik Shiraly wrote:One way to do this is a UDP multicast or broadcast.
In multicast, the application running on all devices joins a hardcoded multicast IP address and listens. One of the devices decides to become the server and advertises itself by sending its IP address in a UDP to the multicast address. The router then forwards that UDP to all members of the multicast group.
Same with broadcast, except that router forwards that packet to all devices on the subnet, and whoever's listening on broadcast address receives it.
A more formal way of doing the same thing is using SSDP (Simple Service Discovery Protocol), which also uses multicasting.