Did you also look at the QUdpSocket? (Qt Broadcast example)
Maybe it would also work this way:
1) Application is started.
2) Application opens a Udp port that is known to all applications.
3) The new app sends out a datagramm
4) Now the app does listen for all responses from other running applications
5) The new app does verify the number of responses and determines the total number of running instances
6.1) If there are too many applications running, the new app terminates itself.
6.2) If it is possible to start another instance, then the new app will close the Udp server socket and open a Udp client socket, listening for broadcast messages itself.
This should really work on any platform.
Bookmarks