Have you considered NSDistributedNotificationCenter?
I would suggest creating a DistributedNotificationCenter
(server) that listens in on notifications sent from the NotificationCenter
. It should simply relay any received messages (or any of registered interest) on to peer DistributedNotificationCenters
(running in other processes).
The question there is how do these DistributedNotificationCenters
"find" each other. Well, there are a number of options:
- A well known
DistributedNotificationCenterLocator
service (server) that hooks them up and may even be the central relay point for all messaging (but that has scalability questions).
- As (1) but you initialise your app with the server:port of the
DistributedNotificationCenterLocator
.
DistributedNotificationCenter
s could register in a database if it's specific to an application - i.e. I am on "server:port". i.e. A well known lookup.
- I've no knowledge of this but see this SO answer relating to the use of Bonjour for server discovery. Sounds interesting?
I've not supplied any code here but let me know if you need any pointers...