Hail allows decentralised automatic discovery of other participants in a Utopia based network music application. It does this by broadcasting a 'hailing signal' consisting of a specified OSC path ('/hail' by default). It automatically adds and informs new Peers, and tracks online status, marking unresponsive Peers as offline.
By using different OSC paths multiple subnetworks can exist on the same physical network. Each participant in a subnetwork should create a Hail with the same path. Since it is decentralised, it does not depend on any one node remaining stable and online.
Hail holds an AddrBook as an instance variable. Users can pass this to other Utopia objects, and know that it will be updated as appropriate. Thus Hail can fufill the role of membership management in a Utopia based system or subsystem.
Create a new Hail.
addrBook |
An optional AddrBook which this instance will use to store discovered Peers. Users can pass this to other Utopia objects, and know that it will be updated as appropriate. If nil, one will be automatically created. |
period |
The interval in seconds between 'hailing signals' being sent. Peers which have not responded for > (2 * period) seconds will be marked offline. |
me |
An optional Peer representing the localhost. If nil one will be automatically created using AddrBook: -addMe. |
authenticator |
An optional authenticator, which is used to authenticate other Peers attempting to join the system. This should be an instance of a subclass of NMLAbstractAuthenticator, such as ChallengeAuthenticator or GroupPasswordAuthenticator. If nil Hail will create an instance of NonAuthenticator (no authentication). |
oscPath |
An OSC compliant path in the form of a Symbol or String used to identify this subnetwork. By using different paths multiple subnetworks can exist on the same physical network. In simple cases the default ('/hail') can be used. |
broadcastAddr |
An optional NetAddr specifying the broadcast address to use for hailing. If none is provided |
A new Hail instance.
Free this object and its OSCFuncs. After this, this Hail (and probably its AddrBook) should not be used.